Skip to content
The Casebook · An idea an AI invented

Sweep of 20-bar low, strong close, volume spike, ATR target

Today's low is below the lowest low of the prior 20 bars, but close is in the top 35% of today's range and close is above the prior close. Volume >= 1.2x 20-day average. Long at close. Stop = today's low minus 0.25*ATR(14). Target = entry + 2*ATR(14).
Why the AI thought it might work

When price spikes through a well-known multi-week low and snaps back to close in the upper part of the range, resting stop orders were harvested and the selling that triggered them is spent. The fast V-shaped recovery leaves trapped shorts and uninformed stop sellers out, giving a short-lived but compelled-flow reversal.

VerdictTested Nov 22, 2026

Indistinguishable from luck

It looks positive, but not more than chance would produce at this many tries, or than the same plan on random dates.

  • Positive (+0.066R a trade), but no market clears t > 2.95 by trade and by day.
Trades on the laggards
437

42 large US stocks, 15 years

Per trade, after costs
+0.066R

Before costs +0.168R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

On 437 laggard trades the result was +0.066R per trade after costs (0.168R before costs). Bull, flat and bear markets all came out positive, but the best t was 0.80, far under the 2.95 bar, and the t-values by day were 0.57, 0.19 and 0.12. Gains this small are within what luck produces, hence the verdict.

How it was tested

The rule as written, coded once, run on every stock the same way.

Side
Long
Time limit
Exit at the close after 30 trading days, unless the stop, the target or its own exit comes first
Bar to clear
t > 2.95, by trade and by day, sized to the 362 rules in the search it came from
Prices
15 years of daily bars through 2026-11-20; judged 2026-11-22

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
Bull280+0.033R0.390.57 · 211d−0.055R · beats 90%+0.016R
Flat91+0.115R0.720.19 · 68d−0.031R · beats 85%+0.308R
Bear66+0.141R0.800.12 · 32d+0.056R · beats 80%−0.119R
All437+0.066R−0.033R+0.067R

R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 10.8 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 LowerWickStopRunReversalLong:
    name = "lower_wick_stop_run_reversal_long"
    description = "Sweep below prior 20-bar low that reverses to close in top 35% of range, above prior close, on 1.2x volume."

    def __init__(self, lookback: int = 20, close_pos_min: float = 0.65, vol_mult: float = 1.2, atr_period: int = 14, stop_atr_buf: float = 0.25, target_atr_mult: float = 2.0, min_rr: float = 1.6, max_risk_atr: float = 3.0, min_bars: int = 60) -> None:
        self._lookback = lookback
        self._close_pos_min = close_pos_min
        self._vol_mult = vol_mult
        self._atr_period = atr_period
        self._stop_atr_buf = stop_atr_buf
        self._target_atr_mult = target_atr_mult
        self._min_rr = min_rr
        self._max_risk_atr = max_risk_atr
        self._min_bars = min_bars

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

        # 1. Sweep: today's low pierces the multi-week low
        if cur.low >= prior_low:
            return None
        rng = cur.high - cur.low
        if rng <= 0:
            return None
        # 2. Snap-back: close in top 35% of range and above prior close
        close_pos = float((cur.close - cur.low) / rng)
        if close_pos < self._close_pos_min:
            return None
        if cur.close <= prev.close:
            return None
        # 3. Volume confirmation
        avg_vol = sum(float(b.volume) for b in prior) / len(prior)
        if avg_vol <= 0:
            return None
        vol_ratio = float(cur.volume) / avg_vol
        if vol_ratio < self._vol_mult:
            return None

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

        entry = cur.close
        # Structural stop: below the sweep low (where the harvest failed)
        stop = cur.low - Decimal(str(self._stop_atr_buf)) * atr_d
        risk = entry - stop
        if risk <= 0:
            return None
        # Only reject absurdly wide bars (risk > 3 ATR); wide capitulation sweeps are kept
        if risk > Decimal(str(self._max_risk_atr)) * atr_d:
            return None
        # Operator target is 2 ATR; on wide sweep bars, scale the target to keep the platform's R:R floor
        target = entry + max(Decimal(str(self._target_atr_mult)) * atr_d, Decimal(str(self._min_rr)) * risk)
        rr = (target - entry) / risk
        if rr <= Decimal("1.5"):
            return None

        # Strength: volume, close position, sweep depth/reclaim
        vol_score = min(35, max(0, int((vol_ratio - 1.0) * 35)))
        close_score = min(30, max(0, int((close_pos - self._close_pos_min) / (1.0 - self._close_pos_min) * 30)))
        depth_atr = float((prior_low - cur.low) / atr_d)
        depth_score = min(15, max(0, int(depth_atr * 30)))
        reclaim_score = 20 if cur.close > prior_low else 5
        strength = max(0, min(100, vol_score + close_score + depth_score + reclaim_score))

        return Candidate(
            ticker=ticker,
            side="buy",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=strength,
            thesis=(
                f"Stop run: low swept the prior {self._lookback}-bar low {prior_low} and reversed to close in the top "
                f"{int((1 - close_pos) * 100)}% of the range on {vol_ratio:.1f}x volume. Stop selling looks exhausted and shorts trapped; "
                f"stop sits below the sweep low."
            ),
        )

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
Sweep of 20-bar low, strong close, volume spike, ATR target: Indistinguishable from luck · EdgeProven