Skip to content
The Casebook · An idea an AI invented

Short after two gap-ups far above the 50-day average

Entry at latest close if the last two bars each opened above the prior bar's high, close is more than 12% above the 50-day SMA, and the latest bar closed below its open. Stop = max high of last 2 bars plus 0.3*ATR(14). Target = entry minus 2.0*ATR(14).
Why the AI thought it might work

Two consecutive gap-ups (open above prior high) in a stock far above its 50-day mean attract retail momentum chasers and short-covering that is mechanical rather than informational. Once forced buyers are exhausted, the final bar closes below its open and supply from earlier holders dominates. Visible from OHLC alone.

VerdictTested Nov 22, 2026

Loses money

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

  • −0.207R a trade after costs on the laggard stocks.
Trades on the laggards
431

42 large US stocks, 15 years

Per trade, after costs
−0.207R

Before costs −0.090R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

Across 431 trades on the laggard stocks, the result was −0.207R a trade after costs, and −0.313R on the winners. Bull markets (344 trades, −0.218R) and flat markets (71 trades, −0.211R) were both negative; bear markets were about zero (0.033R, 16 trades). The verdict follows from the loss on the laggards.

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
Bull344−0.218R−2.48−2.18 · 294d−0.158R · beats 25%−0.261R
Flat71−0.211R−1.17−0.90 · 61d−0.194R · beats 50%−0.628R
Bear16+0.033R0.070.39 · 13d−0.320R · beats 90%+0.030R
All431−0.207R−0.170R−0.313R

R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 7.6 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 ConsecutiveGapUpExhaustionShort:
    name = "consecutive_gap_up_exhaustion_close_below_open_short"
    description = "Two consecutive gap-up opens in a stock extended above its 50-SMA, final bar closes below its open; short the exhaustion."

    def __init__(self, sma_len: int = 50, ext_pct: float = 0.10, gap_vs_high: bool = False,
                 atr_len: int = 14, stop_atr: float = 0.3, target_atr: float = 2.0,
                 min_rr: float = 1.5) -> None:
        self._sma_len = sma_len
        self._ext = ext_pct
        self._gap_vs_high = gap_vs_high
        self._atr_len = atr_len
        self._stop_atr = stop_atr
        self._target_atr = target_atr
        self._min_rr = min_rr

    def _gapped(self, cur, prev) -> bool:
        ref = prev.high if self._gap_vs_high else prev.close
        return cur.open > ref

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        if len(bars) < max(60, self._sma_len + 10):
            return None
        cur = bars[-1]
        prev = bars[-2]
        base = bars[-3]
        if not (self._gapped(cur, prev) and self._gapped(prev, base)):
            return None
        if cur.close >= cur.open:
            return None
        sma_v = sma([b.close for b in bars], self._sma_len)
        if sma_v is None or sma_v <= 0:
            return None
        sma_d = Decimal(str(sma_v))
        ext = float((cur.close - sma_d) / sma_d)
        if ext <= self._ext:
            return None
        atr_v = atr(bars, self._atr_len)
        if atr_v is None or atr_v <= 0:
            return None
        atr_d = Decimal(str(atr_v))

        entry = cur.close
        stop = max(cur.high, prev.high) + Decimal(str(self._stop_atr)) * atr_d
        risk = stop - entry
        if risk <= 0:
            return None
        target = entry - Decimal(str(self._target_atr)) * atr_d
        used_gap_fill = False
        min_rr = Decimal(str(self._min_rr))
        # Platform requires R:R > 1.5. Deep red reversals have wide stops;
        # rather than drop them, extend the target to the structural gap-fill
        # level (close before the first gap) when that restores R:R.
        if (entry - target) / risk <= min_rr:
            gap_fill = base.close
            if gap_fill < target and (entry - gap_fill) / risk > min_rr:
                target = gap_fill
                used_gap_fill = True
        if target <= 0 or target >= entry:
            return None
        rr = (entry - target) / risk
        if rr <= min_rr:
            return None

        # Strength: extension, red-bar decisiveness, volume, gap size
        ext_score = min(30, max(0, int((ext - self._ext) * 150)))
        rng = max(cur.high - cur.low, Decimal("0.01"))
        body_down = float((cur.open - cur.close) / rng)
        close_low = float((cur.high - cur.close) / rng)
        decis_score = min(30, max(0, int(body_down * 15 + close_low * 15)))
        avg_vol = sum(b.volume for b in bars[-22:-2]) / 20
        vr = float(cur.volume) / max(float(avg_vol), 1.0)
        vol_score = min(25, max(0, int((vr - 1.0) * 20)))
        gap_tot = float((prev.open - base.close) + (cur.open - prev.close)) / float(atr_d)
        gap_score = min(15, max(0, int(gap_tot * 10)))
        strength = max(0, min(100, ext_score + decis_score + vol_score + gap_score))

        thesis = (
            f"Two consecutive gap-up opens with close {ext*100:.1f}% above the {self._sma_len}-SMA; "
            f"final bar closed below its open, a sign that mechanical chase/short-cover demand is exhausted. "
            f"Stop above the 2-bar high + {self._stop_atr} ATR; target "
            + ("pre-gap close (gap fill)." if used_gap_fill else f"{self._target_atr} ATR below entry.")
        )
        return Candidate(
            ticker=ticker,
            side="sell",
            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
Short after two gap-ups far above the 50-day average: Loses money · EdgeProven