Skip to content
The Casebook · An idea an AI invented

Short after a gap-up that reverses below the prior close

Entry at latest close if latest open was above the prior high, close is below the prior close, volume >= 1.3x the 20-day average, and close is below the 50-day SMA with the 50-day SMA falling. Stop = latest high plus 0.2*ATR(14). Target = entry minus 2.0*ATR(14).
Why the AI thought it might work

A gap-up open that fully reverses to close below the prior day's close in a downtrend traps early buyers and shorts who covered. Trapped longs sell on the next bounce and confidence in the rally evaporates, so supply continues. Distinct from simple fades because it requires price below the 50-day SMA and volume above average.

VerdictTested Nov 22, 2026

Loses money

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

  • −0.197R a trade after costs on the laggard stocks.
Trades on the laggards
180

42 large US stocks, 15 years

Per trade, after costs
−0.197R

Before costs −0.067R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

On the laggard stocks this short averaged −0.197R a trade after costs over 180 trades, and −0.067R before costs. The 20 winners did worse, at −0.424R. Bull and flat markets were negative (−0.245R, −0.363R); bear was +0.096R on 39 trades, with t 0.37. The verdict follows from the negative result across all 180 trades.

How it was tested

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

Side
Short
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
Bull102−0.245R−1.60−1.54 · 97d−0.174R · beats 35%−0.281R
Flat39−0.363R−1.62−1.29 · 32d−0.132R · beats 15%−0.613R
Bear39+0.096R0.37−0.25 · 34d−0.065R · beats 70%−0.700R
All180−0.197R−0.141R−0.424R

R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 13.5 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, sma
from scanners.base import Candidate


class GapUpFailureTrappedLongsShort:
    name = "gap_up_failure_trapped_longs_short"
    description = "Gap-up that reverses to close below prior close on heavy volume under a falling 50-SMA; short the trapped longs"

    def __init__(self, sma_period: int = 50, slope_lookback: int = 5, vol_mult: float = 1.2, gap_atr_buffer: float = 0.3, stop_atr_buffer: float = 0.2, target_atr_mult: float = 2.0, min_rr: float = 1.5) -> None:
        self._sma_period = sma_period
        self._slope_lookback = slope_lookback
        self._vol_mult = vol_mult
        self._gap_atr_buffer = gap_atr_buffer
        self._stop_atr_buffer = stop_atr_buffer
        self._target_atr_mult = target_atr_mult
        self._min_rr = min_rr

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        need = self._sma_period + self._slope_lookback + 25
        if len(bars) < need:
            return None
        cur = bars[-1]
        prev = bars[-2]

        atr_val = atr(bars, 14)
        if atr_val is None or atr_val <= 0:
            return None
        atr_d = Decimal(str(atr_val))

        # Gap-up: open above prior high OR open well above prior close
        gap_ok = cur.open > prev.high or cur.open >= prev.close + Decimal(str(self._gap_atr_buffer)) * atr_d
        if not gap_ok:
            return None
        # Full reversal: close below prior close
        if cur.close >= prev.close:
            return None

        # Volume confirmation
        prior_vols = [float(b.volume) for b in bars[-21:-1]]
        avg_vol = sum(prior_vols) / len(prior_vols)
        if avg_vol <= 0:
            return None
        vol_ratio = float(cur.volume) / avg_vol
        if vol_ratio < self._vol_mult:
            return None

        # Downtrend: below falling 50-SMA
        closes = [float(b.close) for b in bars]
        sma_now = sma(closes, self._sma_period)
        sma_prev = sma(closes[:-self._slope_lookback], self._sma_period)
        if sma_now is None or sma_prev is None:
            return None
        if float(cur.close) >= sma_now or sma_now >= sma_prev:
            return None

        entry = cur.close
        stop = cur.high + Decimal(str(self._stop_atr_buffer)) * atr_d
        target = entry - Decimal(str(self._target_atr_mult)) * atr_d
        if not (target < entry < stop) or target <= 0:
            return None
        risk = stop - entry
        if risk <= 0:
            return None
        rr = (entry - target) / risk
        if rr < Decimal(str(self._min_rr)):
            return None

        a = float(atr_d)
        # Volume component (0-35)
        vol_score = min(35.0, max(0.0, (vol_ratio - 1.0) * 35.0))
        # Reversal depth: gap size + close below prior close, in ATR (0-35)
        gap_size = (float(cur.open) - float(prev.close)) / a
        below = (float(prev.close) - float(cur.close)) / a
        rev_score = min(35.0, max(0.0, (gap_size + below) * 20.0))
        # Close near the low (0-20)
        rng = float(cur.high - cur.low)
        close_pos = (float(cur.high) - float(cur.close)) / rng if rng > 0 else 0.0
        close_score = min(20.0, max(0.0, close_pos * 20.0))
        # Trend slope (0-10)
        slope_pct = (sma_prev - sma_now) / sma_prev if sma_prev > 0 else 0.0
        trend_score = min(10.0, max(0.0, slope_pct * 500.0))
        strength = int(max(0, min(100, vol_score + rev_score + close_score + trend_score)))

        return Candidate(
            ticker=ticker,
            side="sell",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=strength,
            thesis=(
                f"Gap-up of {gap_size:.2f} ATR fully reversed to close {below:.2f} ATR below prior close "
                f"on {vol_ratio:.1f}x volume under a falling 50-SMA; trapped gap buyers should supply bounces."
            ),
        )

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
Short after a gap-up that reverses below the prior close: Loses money · EdgeProven