Skip to content
The Casebook · An idea an AI invented

Oversold bounce after volume and range contraction

Close is down >= 12% over the last 12 bars, ATR(5) < 0.7x ATR(20), today's volume < 0.7x 20-day average, and today's close >= prior close. Long at close. Stop = lowest low of last 5 bars minus 0.3*ATR(14). Target = entry + 3*ATR(14).
Why the AI thought it might work

Stocks with persistent selling and rising daily true range, then a sudden contraction of range and volume, show sellers have run out of urgency. Margin-forced sellers are done, short sellers with profit targets take gains on the quiet days, creating a vacuum that resolves upward.

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.534R a trade), but no market clears t > 2.95 by trade and by day.
Trades on the laggards
82

42 large US stocks, 15 years

Per trade, after costs
+0.534R

Before costs +0.624R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

On laggards the idea averaged +0.534R a trade over 82 trades after costs, against −0.179R on the winners. But no market cleared the t > 2.95 bar: bull reached 1.58, flat 2.02 by day, and bear was −0.7 over only 6 trades. That is why the verdict is indistinguishable from luck.

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
Bull57+0.468R1.581.58 · 57d−0.081R · beats 95%−0.293R
Flat19+1.007R1.932.02 · 17d+0.008R · beats 100%+0.577R
Bear6−0.328R−0.70−0.70 · 6d+0.842R · beats 25%−1.327R
All82+0.534R+0.007R−0.179R

R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 6.3 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 SqueezeAfterHighRangeDownStreakLong:
    name = "squeeze_after_high_range_down_streak_long"
    description = "Long after a >=12% 12-bar decline followed by range and volume contraction and a non-down close"

    def __init__(
        self,
        drop_lookback: int = 12,
        min_drop_pct: float = 0.12,
        atr_ratio_max: float = 0.78,
        vol_ratio_max: float = 0.8,
        stop_window: int = 5,
        stop_atr_buffer: float = 0.3,
        target_atr_mult: float = 3.0,
        min_price: float = 2.0,
        min_bars: int = 60,
    ) -> None:
        self._drop_lookback = drop_lookback
        self._min_drop = min_drop_pct
        self._atr_ratio_max = atr_ratio_max
        self._vol_ratio_max = vol_ratio_max
        self._stop_window = stop_window
        self._stop_buf = stop_atr_buffer
        self._tgt_mult = target_atr_mult
        self._min_price = min_price
        self._min_bars = min_bars

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        if len(bars) < max(self._min_bars, self._drop_lookback + 25):
            return None
        cur = bars[-1]
        prev = bars[-2]
        if float(cur.close) < self._min_price:
            return None
        if cur.close < prev.close:
            return None

        base_close = float(bars[-(self._drop_lookback + 1)].close)
        if base_close <= 0:
            return None
        ret = float(cur.close) / base_close - 1.0
        if ret > -self._min_drop:
            return None

        atr5 = atr(bars, 5)
        atr20 = atr(bars, 20)
        atr14 = atr(bars, 14)
        if atr5 is None or atr20 is None or atr14 is None:
            return None
        atr5 = float(atr5)
        atr20 = float(atr20)
        atr14 = float(atr14)
        if atr5 <= 0 or atr20 <= 0 or atr14 <= 0:
            return None
        atr_ratio = atr5 / atr20
        if atr_ratio >= self._atr_ratio_max:
            return None

        vols = [float(b.volume) for b in bars[-21:-1]]
        avg_vol = sum(vols) / len(vols) if vols else 0.0
        if avg_vol <= 0:
            return None
        vol_ratio = float(cur.volume) / avg_vol
        if vol_ratio >= self._vol_ratio_max:
            return None

        atr14_d = Decimal(str(atr14))
        entry = cur.close
        low_n = min(b.low for b in bars[-self._stop_window:])
        stop = low_n - Decimal(str(self._stop_buf)) * atr14_d
        if stop <= 0 or stop >= entry:
            return None
        target = entry + Decimal(str(self._tgt_mult)) * atr14_d
        risk = entry - stop
        if risk <= 0 or target <= entry:
            return None
        rr = (target - entry) / risk
        if rr < Decimal("1.5"):
            return None

        # Score: contraction depth, volume dryness, drop magnitude, close location
        contr_score = max(0.0, min(35.0, (self._atr_ratio_max - atr_ratio) / 0.3 * 35.0))
        vol_score = max(0.0, min(25.0, (self._vol_ratio_max - vol_ratio) / 0.4 * 25.0))
        drop_score = max(0.0, min(20.0, (-ret - self._min_drop) / 0.15 * 20.0))
        rng = cur.high - cur.low
        if rng > 0:
            close_pos = float((cur.close - cur.low) / rng)
        else:
            close_pos = 0.5
        close_score = max(0.0, min(20.0, close_pos * 20.0))
        strength = int(max(0, min(100, round(contr_score + vol_score + drop_score + close_score))))

        thesis = (
            f"Down {(-ret) * 100:.1f}% over {self._drop_lookback} bars, then range contracted "
            f"(ATR5/ATR20={atr_ratio:.2f}) on dry volume ({vol_ratio:.2f}x avg) with a non-down close: "
            f"forced selling looks exhausted and quiet short covering can resolve upward. "
            f"Stop below the {self._stop_window}-bar low, target +{self._tgt_mult:g} ATR."
        )

        return Candidate(
            ticker=ticker,
            side="buy",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=strength,
            thesis=thesis,
        )

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
Oversold bounce after volume and range contraction: Indistinguishable from luck · EdgeProven