Hammer candlestick: confirmation and failures
A hammer candlestick has a small body near the top of its range and a lower shadow at least twice the body length. After a decline, it marks a possible bullish reversal. A red or green body can qualify. The candle records a recovery from its low; it does not establish that the downtrend has ended. Confirmation requires later price action.
Key Takeaways
- A hammer needs both the lower-shadow shape and a stated downtrend context.
- Red and green bodies can qualify; neither color replaces confirmation.
- A confirmation decision belongs to the bar on which it becomes known, and it can still be followed by failure.
Measure the body and shadows before naming the pattern
For an ordinary OHLC candle, the body is the absolute difference between close and open. The lower shadow runs from the low to the lower of open and close; the upper shadow runs from the higher of open and close to the high. StockCharts describes a lower shadow at least twice the body and little or no upper shadow. The extra cutoffs below are illustrative detection choices, not a universal definition or an optimized trading rule.
| Measurement | Illustrative requirement | Reason |
|---|---|---|
| Range | High minus low must be positive | Exclude bars with no price range. |
| Body | More than zero and at most 30% of the range | Keep a small real body; classify exact doji separately. |
| Lower shadow | At least 2 times the body | Require the defining long lower shadow. |
| Upper shadow | At most 10% of the range | Give the short upper shadow a numeric limit. |
| Trend | Hammer close below the 50-period SMA | Use a stated downtrend filter instead of shape alone. |
- A near-zero body can pass a wick-to-body ratio too easily. Test a minimum body size relative to the market tick size if such candles dominate the results.
- TradingView offers SMA50, SMA50 with SMA200, or no trend detection for its Hammer indicator. These settings can produce different labels on the same chart.
- The table is a custom specification. It is not a claim that TradingView or Pineify uses these exact thresholds by default.
Red hammer, green hammer, or hanging man?
Color describes the open-to-close change; trend context gives the shape its name. A red hammer candlestick closes below its open but can still finish far above its low. A green hammer candlestick closes above its open. Neither color establishes a win rate, and green alone does not confirm the next bar will rise.
| Candle | Required context | What to check next |
|---|---|---|
| Red hammer | Decline before the candle; close below open | Later bullish confirmation, using the same rule as a green hammer. |
| Green hammer | Decline before the candle; close above open | Whether later price clears the chosen confirmation level. |
| Hanging man | Advance before the candle | Possible bearish reversal context; do not label it a bullish hammer. |
| Inverted hammer | Decline, but the long shadow is above the body | A different shape with its own confirmation requirements. |
Separate a completed hammer from a confirmed setup
Use two timestamps: the hammer close and the confirmation close. For the illustrative rule here, the next candle must close above the hammer high and must not trade below the hammer low. If it does neither, the one-bar confirmation window expires. This is stricter than a close above the hammer close. It delays the decision by one full candle and can leave a larger distance to the invalidation level.
- Wait for the hammer bar to close before measuring its final body and shadows. Its high, low, and close can change while it is open.
- Record the confirmation on the next bar. Plotting that decision back on the hammer would hide when the information became available.
- Before confirmation, a trade below the hammer low cancels this setup. After confirmation, the same break invalidates its low-holding premise.
- A backtest must specify the actual order time, stop buffer, exit rule, costs, and slippage. Confirmation is not a fill price or a profit target.
Illustrative chart: confirmation and follow-through
This hypothetical sequence uses price units, not an identified security. The hammer opens at 99, closes at 100, reaches 100.2, and falls to 96: body 1, lower shadow 3, upper shadow 0.2, range 4.2. It passes the table thresholds. Assume the 50-period SMA is 104 at the hammer close; the short chart alone cannot calculate that average. The next close of 101.2 clears 100.2 while its low stays above 96. That confirms the stated setup; the following rise illustrates follow-through, not measured strategy performance.
| Bar | Open | High | Low | Close |
|---|---|---|---|---|
| Decline 1 | 108 | 109 | 104 | 105 |
| Decline 2 | 105 | 106 | 101 | 102 |
| Hammer | 99 | 100.2 | 96 | 100 |
| Confirm | 100 | 102 | 99.5 | 101.2 |
| Follow-through | 101.5 | 104.5 | 101 | 104 |
Hollow bodies close at or above the open. Filled bodies close below the open.
Illustrative data authored for this explanation. No trade execution, target, fees, or return is represented. The assumed SMA uses earlier bars not shown.
Illustrative chart: a confirmed hammer can still fail
Keep the same hammer and confirmation candle, then change only the following bar. Its low of 95.5 breaks the hammer low of 96, so the setup fails the stated invalidation rule despite having confirmed. A stop below 96 is an order instruction, not a promise to exit at that price; gaps and execution costs can increase the loss. Counting only hammers followed by rallies would exclude this outcome and bias a test.
| Bar | Open | High | Low | Close |
|---|---|---|---|---|
| Decline 1 | 108 | 109 | 104 | 105 |
| Decline 2 | 105 | 106 | 101 | 102 |
| Hammer | 99 | 100.2 | 96 | 100 |
| Confirm | 100 | 102 | 99.5 | 101.2 |
| Invalidation | 101 | 101.5 | 95.5 | 96.5 |
Hollow bodies close at or above the open. Filled bodies close below the open.
Illustrative failure branch using the same initial conditions. It is not a historical trade or an estimate of failure frequency.
Compare the rule with a traceable historical chart
The StockCharts source linked below includes a Nike (NKE) hammer at a mid-March support retest, followed by a sharp advance two days later. That example is useful precisely because its confirmation timing differs from the one-bar rule above. It supports examining later price action; it does not validate these particular thresholds or supply a success rate. Use the original chart for its annotations rather than assigning invented dates, fills, or returns to it.
Test a hammer rule without fitting it to one attractive chart
Fix the market, timeframe, trend filter, confirmation window, and exits before comparing results. Then count every qualifying hammer, including expired and failed setups. Separate red and green bodies only as a declared test. Report trade count, drawdown, costs, and results on a period excluded from parameter selection; a high win rate can still accompany large losses.
- Pineify AI Coding Agent can help turn the explicit geometry and next-bar rules into Pine Script for review in TradingView.
- Visual Editor includes a Hammer output in its Candlestick Patterns indicator. Check its preset definition before treating it as equivalent to the custom rules here.
- Strategy Optimizer can compare exposed strategy input combinations. Use it to test sensitivity to thresholds, not to establish a universal hammer win rate.
Pineify next step
Turn the hammer definition into a testable script
Give Pineify the body and shadow thresholds, trend filter, confirmation window, invalidation rule, and exits. Review the generated Pine Script against both illustrative paths before evaluating historical results.
For educational purposes only, not investment advice. Chart scenarios are hypothetical and are not backtest or live trading results. Trading can result in losses; confirmation and historical results do not guarantee future performance.