Skip to content
The Casebook · A classic strategy

Hammer candle at a 20-day low, long entry

Buy a hammer candle (lower shadow at least twice the body) at a 20-day low.
VerdictTested Nov 22, 2026

Loses money

After costs it lost money on the stocks that decide the verdict.

  • −0.098R a trade after costs on the laggard stocks.
Trades on the laggards
561

42 large US stocks, 15 years

Per trade, after costs
−0.098R

Before costs +0.014R

Bar to clear
t > 2.01

By trade and by day, sized to a first try

What the numbers say

On the laggard stocks the idea averaged −0.098R a trade after costs over 561 trades, against +0.063R on today's winners. Before costs the result was close to zero, so trading costs account for the loss. By market type: bull −0.081R, flat 0.024R, bear −0.384R, the last beating 0.0% of random-date draws.

How it was tested

Buy at the close when a hammer candle (lower shadow at least twice the body) forms at a 20-day low, and hold with a bracket stop and target.

Side
Long
Time limit
Exit at the close after 10 trading days, unless the stop, the target or its own exit comes first
Bar to clear
t > 2.01, by trade and by day, sized to a first try (one idea, tested once)
Prices
15 years of daily bars through 2026-11-20; judged 2026-11-22
Choices made where the idea was open
  • Hammer: body above zero, lower shadow at least 2 x body, upper shadow no larger than the body, close in the upper half of the day's range.
  • 20-day low means the signal day's low is the lowest low of the last 20 daily bars including that day.
  • Candle colour (up or down body) is not required to matter.
  • No stop or target was given: stop is just below the hammer's low (floored at 1 x ATR(14) risk logic as stated), target is 2R.
  • No holding period was given: 10 trading days chosen as the time exit at the close.

The evidence

The laggards decide: 22 large stocks that lagged or fell, where hindsight can't flatter a rule. Today's winners sit beside them to show what survivorship would add.

MarketTradesPer tradet, by tradet, by dayRandom datesWinners, per trade
Bull335−0.081R−1.03−0.77 · 277d−0.093R · beats 55%−0.049R
Flat144+0.024R0.21−0.21 · 90d−0.033R · beats 65%+0.357R
Bear82−0.384R−2.62−1.98 · 48d+0.007R · beats 0%−0.032R
All561−0.098R−0.063R+0.063R

R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 9.9 bps) plus 0.045R for the fills a real order wouldn't get. “By day” groups trades opened the same day, so a rule that fires on the same dates for every stock counts as a few events. “Random dates” places the same plan on random days of the same stocks in the same kind of market, 20 times; the idea must beat 95% of those draws.

The scanner we wroteShow the code
from decimal import Decimal

from core.domain import Bar
from strategies.indicators import atr
from scanners.base import Candidate


class HammerCandleAt20DayLow:
    name = "hammer_candle_at_20_day_low"
    description = "Hammer candle forming at a 20-day low; long at close with ATR stop and 2R target"

    def __init__(self, low_lookback: int = 20, atr_period: int = 14,
                 shadow_mult: float = 2.0, stop_atr_mult: float = 1.0,
                 low_buffer_atr: float = 0.1, target_r: float = 2.0) -> None:
        self._lookback = low_lookback
        self._atr_period = atr_period
        self._shadow_mult = Decimal(str(shadow_mult))
        self._stop_atr_mult = Decimal(str(stop_atr_mult))
        self._low_buffer_atr = Decimal(str(low_buffer_atr))
        self._target_r = Decimal(str(target_r))

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        need = max(self._lookback, self._atr_period + 1)
        if len(bars) < need:
            return None
        cur = bars[-1]
        window = bars[-self._lookback:]
        if cur.low > min(b.low for b in window[:-1]):
            return None

        body = abs(cur.close - cur.open)
        if body <= 0:
            return None
        top = max(cur.open, cur.close)
        bottom = min(cur.open, cur.close)
        lower = bottom - cur.low
        upper = cur.high - top
        if lower < self._shadow_mult * body:
            return None
        if upper > body:
            return None
        rng = cur.high - cur.low
        if rng <= 0:
            return None
        if (cur.close - cur.low) / rng < Decimal("0.5"):
            return None

        atr_val = atr(bars, self._atr_period)
        if atr_val is None or atr_val <= 0:
            return None
        a = Decimal(str(atr_val))

        entry = cur.close
        atr_stop = entry - self._stop_atr_mult * a
        low_stop = cur.low - self._low_buffer_atr * a
        # 1xATR stop from entry; if the signal low (minus buffer) is further below, use that.
        stop = min(atr_stop, low_stop)
        risk = entry - stop
        if risk <= 0:
            return None
        target = entry + self._target_r * risk
        rr = (target - entry) / risk

        return Candidate(
            ticker=ticker,
            side="buy",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=50,
            thesis=f"Hammer candle at a {self._lookback}-day low; stop below the lower of entry-1xATR and low-0.1xATR, 2R target.",
        )

Hypothetical results from our own backtest of the rule as restated, on 42 large US stocks over 15 years. Past performance, real or simulated, does not predict future results. Research and education only; not investment advice.

Have an idea of your own?

Describe it in plain words and get the same honest test in about a minute.

Run the Gauntlet
Hammer candle at a 20-day low, long entry: Loses money · EdgeProven