Browse the library

Candlesticks · Single-candle patterns

Inverted hammer candlestick: TA-Lib rules and real results

How an inverted hammer forms after a decline, the body-gap test TA-Lib requires, why confirmation mattered most here, and 352 real cases.

On this page
  1. Anatomy of an inverted hammer
  2. The exact rules Finabase uses
  3. Why buyers' failed attempt can matter
  4. Confirmation decides this pattern
  5. Two inverted hammers from 2026
  6. What 352 inverted hammers did next
  7. Inverted hammer versus its look-alikes
  8. An educational outline
  9. How Finabase shows inverted hammers
  10. Frequently asked questions
  11. Summary

Turn a Hammer candlestick pattern: meaning, rules and reliability upside down and you get the inverted hammer: a small real body at the bottom of the session's range with a long upper shadow sticking up above it. It shows up after a decline, and it records a session in which buyers tried to rally the stock, got a good distance, and then gave most of it back by the close.

On first sight that sounds bearish, and the same candle after an advance is indeed called a Shooting star candlestick: definition, TA-Lib test and track record. The bullish reading after a decline rests on a subtler argument: for the first time in a while, buyers were strong enough to lift the price meaningfully during the day. The failure to hold the gain matters less than the fact that the attempt happened at all. Whether that attempt was the start of something is decided by the following sessions, which is why the inverted hammer is one of the patterns where confirmation does the heavy lifting.

Below: what the candle looks like, the gap test TA-Lib adds, two real cases from summer 2026 that looked alike and ended 38 percentage points apart, and what 352 inverted hammers on 60 large US stocks and ETFs did over the following week.

Anatomy of an inverted hammer

Inverted hammer below the prior body after a decline (illustration, prices not real) Inverted hammer Confirmation
An inverted hammer at the bottom of a decline. Its body sits entirely below the previous candle’s body.

The parts, read from left to right in the session:

  1. The open is weak. In the strict version the session opens below the prior candle's body, extending the decline.
  2. Buyers push up. The long upper shadow marks how high they got. It is typically at least twice the body's height in textbook examples.
  3. Sellers return before the bell. The close lands back near the open, leaving only a small body. Its color is secondary; a green body shows buyers at least held a gain.
  4. No meaningful lower shadow. The session did not trade much below the body, so the open or close is close to the day's low.

Compared with the hammer, the inverted hammer is the less convincing cousin. The hammer shows buyers winning a fight that sellers started. The inverted hammer shows buyers starting a fight and losing it, at least for the day.

The exact rules Finabase uses

Finabase draws inverted hammer markers and scans for them with TA-Lib's CDLINVERTEDHAMMER. The sizes are judged against the stock's recent candles:

Condition in CDLINVERTEDHAMMER Default threshold
Small real body Shorter than the average body of the previous 10 candles
Long upper shadow Longer than the candle's own real body
Very short lower shadow Under 10% of the average high–low range of the previous 10 candles
Real-body gap down The top of today's body is below the bottom of yesterday's body

When all four pass the output is +100. The function has no bearish output.

The gap is the location test

Where the hammer's location rule says "near the prior low", the inverted hammer's rule is stricter: a real-body gap. The higher of today's open and close must be under the lower of yesterday's open and close. Shadows may overlap, but the bodies may not. This keeps the detector from flagging an upper-shadow candle that simply sits in the middle of a range.

The gap rule also makes the inverted hammer and the shooting star mutually exclusive in TA-Lib. The shooting star needs a body gap up. One candle cannot do both, and in our sample of 29,760 bars the two never fired together.

What TA-Lib does not check

  • No downtrend test. A one-day gap below the previous body is enough. 61.7% of the inverted hammers in our sample followed a 10-session decline; the rest did not.
  • A lenient shadow ratio. "Longer than the body" passes candles that most chart readers would call ordinary.
  • Doji bodies count. About 26% of our inverted hammers were also flagged as gravestone dojis, where the open and close are almost equal. TA-Lib does not separate the two.

Why buyers' failed attempt can matter

After a stretch of falling prices, sessions tend to look alike: weak opens, weak closes, small rallies that get sold. An inverted hammer breaks the rhythm in one respect. Intraday, buyers managed a move large enough to leave a tall shadow, which can mean short sellers were covering or that buyers who had waited on the sidelines tested the water.

Nison's interpretation is that the long upper shadow, combined with the low open, shows the bears' grip loosening. If the next session opens above the inverted hammer's body, anyone who shorted during the day is now underwater, and their buying-to-cover can add fuel. If instead the next session opens lower again, the rally attempt has been rejected twice and the downtrend is intact.

Confirmation decides this pattern

Most traders who use the inverted hammer wait for one of these:

  • A close above the inverted hammer's high on the next session. The study below uses this definition. It is demanding, because the high is the top of the long upper shadow.
  • A gap up above the body, which some practitioners accept as earlier evidence.
  • Supporting momentum, such as a bullish divergence on the Relative Strength Index (RSI): how to read and use it (a lower price low with a higher RSI low) as the candle forms.

Only 61 of 352 inverted hammers (17%) cleared the strict bar. That small group behaved very differently from the rest, as the data section shows.

Two inverted hammers from 2026

IBM (IBM) daily — an inverted hammer after a 32% ten-session drop, July 2026 $200 $250 $300 Inverted hammer 2026-07-22 +14.7% after 10 sessions Jul Aug
IBM: an inverted hammer on 2026-07-22 after a 31.9% fall in ten sessions. Ten sessions later the stock was 14.7% higher.

IBM, July 22, 2026. IBM had lost 31.9% in ten sessions. On July 22 it opened at $207.68, below the prior session's $210.50 close, pushed to $212.34, and closed at $205.77. The $4.66 upper shadow was more than twice the $1.91 body, and the $1.04 lower shadow squeezed under TA-Lib's limit (10% of a $10.59 average range) by two cents. The next session closed at $206.65, short of the $212.34 high, so the strict confirmation never came. The rebound came anyway: +10.0% after five sessions and +14.7% after ten.

Oracle (ORCL) daily — an inverted hammer that marked no bottom, June 2026 $150 $200 $250 Inverted hammer 2026-06-17 −23.6% after 10 sessions Jun Jul
Oracle (ORCL): an inverted hammer on 2026-06-17 after a 20.3% decline. Ten sessions later the stock was 23.6% lower.

Oracle, June 17, 2026. ORCL had fallen 20.3% over ten sessions. It opened at $186.16, below the prior body, rallied to $190.19 and closed at $183.53, a red inverted hammer with a $4.03 upper shadow on a $2.63 body. The next close, $184.29, stayed well under the high. The decline then accelerated: −16.9% after five sessions and −23.6% after ten.

Put side by side, these two are hard to tell apart on the day they printed. Both followed steep declines, both gapped below the prior body, both were red, and neither confirmed by the strict rule. One preceded a sharp rebound and the other a collapse. That is the honest picture of an unconfirmed single candle.

What 352 inverted hammers did next

We scanned two years of daily bars (October 30, 2024 to October 29, 2026) for 60 large US stocks and ETFs with CDLINVERTEDHAMMER, then measured how often the price was higher five sessions later.

Group Cases Higher after 5 sessions Avg 5-session return Avg 10-session return
Any trading day (baseline) 29,760 53.1% — —
Every inverted hammer 352 53.3% +0.34% +0.27%
Confirmed (next close above the high) 61 70.5% +1.55% —

Confirmed results are measured from the confirmation close, so the confirming day's own gain is not counted. 345 of the 352 had five full sessions after them.

  • The candle alone was indistinguishable from a random day: 53.3% against 53.1%.
  • Confirmed cases stood out. 70.5% higher with a +1.55% average is the strongest confirmed result among the single-candle patterns we tested. A close above the high of a long upper shadow is a real show of strength, and the sample suggests it mattered more than the shape itself.
  • The confirmed group is small. 61 cases spread over two years can swing a lot with a few outcomes, and no single month supplied more than about one in ten of them.

Inverted hammer versus its look-alikes

Pattern Shape Location TA-Lib checks Output
Inverted hammer Small body at the bottom, long upper shadow Body gaps below prior body +100
Shooting star candlestick: definition, TA-Lib test and track record Same shape Body gaps above prior body −100
Hammer candlestick pattern: meaning, rules and reliability Small body at the top, long lower shadow Body near the prior low +100
Gravestone doji Doji-sized body at the low, long upper shadow None +100
Hanging man candlestick: rules, context and what the data shows Small body at the top, long lower shadow Body near the prior high −100

The gravestone doji row shows a Finabase quirk worth remembering: TA-Lib scores every gravestone +100, so a gravestone that prints at a top still lands in the scanner's Bullish list. The inverted hammer at least checks for a gap below the prior body.

An educational outline

How practitioners typically approach the pattern. This is not a recommendation.

  1. Require a real decline and, ideally, a level that has mattered before: prior support or a long-term average.
  2. Wait for the strict confirmation, a close above the inverted hammer's high. Accept that you will miss cases like IBM's, in exchange for skipping cases like Oracle's.
  3. Place invalidation under the candle's low. The inverted hammer's low is close to its body, so this risk is usually tighter than a hammer's.
  4. Example with round numbers: an inverted hammer spans $47.80 to $50.60; the next session closes at $50.90. Entry $50.90, invalidation $47.70, risk $3.20 per share. A $320 risk budget gives 100 shares. Illustrative only.

How Finabase shows inverted hammers

  • Chart markers. Turn on the Inverted Hammer study (the IBM link above has it on) to see every bar TA-Lib flags on that stock's daily chart.
  • Scanner. On the S&P 500 scan it appears in the Bullish list, because the detector only outputs +100. The scan shows the latest session; check the trend yourself.
  • Signals tab. On a symbol's Signals page the Candlestick gauge counts an inverted hammer in the last eight bars as a Buy vote. In our sample it was voting Buy on 9.1% of days and neutral otherwise.

Frequently asked questions

Is an inverted hammer bullish or bearish?

It is a potential bullish reversal when it appears after a decline. The same shape after an advance is a shooting star, which is bearish. TA-Lib tells them apart by the direction of the body gap.

Is an inverted hammer weaker than a hammer?

Traditionally yes, because the close fails to hold the session's rally. In our data both were close to random unconfirmed, and confirmed inverted hammers actually did better, on a small sample.

Does an inverted hammer need a gap?

In TA-Lib, yes: the body must be entirely below the previous body. Many textbook descriptions only ask for a small body near the low after a decline, so you will see candles called inverted hammers elsewhere that Finabase does not mark.

What confirms an inverted hammer?

Most commonly a close above its high on the next session. A gap up above the body is an earlier, looser signal.

Summary

The inverted hammer records a rally attempt inside a decline that failed by the close. TA-Lib requires a small body, a long upper shadow, almost no lower shadow and a real-body gap below the prior candle, and it does not check the trend. In our 352-case test the candle by itself was a coin flip, while the 61 cases confirmed by a close above the high did markedly better. The candle is a question; the next session's close is the answer.

Sources and further reading

  1. Steve Nison, Japanese Candlestick Charting Techniques (New York Institute of Finance, 1991)
  2. Thomas N. Bulkowski, Encyclopedia of Candlestick Charts (Wiley, 2008)
  3. TA-Lib source code — CDLINVERTEDHAMMER and the default candle settings
  4. Finabase chart data — daily bars for 60 US stocks and ETFs, 2024-10-30 to 2026-10-29; patterns detected with TA-Lib CDLINVERTEDHAMMER