Skip to content
The Casebook · An idea an AI invented

Buy big overnight gap-downs that recover intraday

Entry at latest close if (open - prior close)/prior close is at most -2.0x its 60-day std of daily overnight returns, close >= open (intraday absorption seen), and close is above the 200-day SMA minus 10%. Stop = low of the bar minus 0.25x ATR(14). Target = entry plus 1.8x ATR(14).
Why the AI thought it might work

Large negative overnight returns come from opening-auction order imbalances and sell-side pressure from constrained participants (margin calls, fund outflow orders sent to the open). Intraday liquidity providers who absorb them earn a premium as price reverts over following sessions. Overnight return is directly observable as open versus prior close in daily bars.

VerdictTested Nov 22, 2026

Loses money

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

  • −0.172R a trade after costs on the laggard stocks.
Trades on the laggards
427

42 large US stocks, 15 years

Per trade, after costs
−0.172R

Before costs −0.060R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

On the laggard stocks the idea lost −0.172R a trade after costs over 427 trades, against 0.055 on today's winners. Flat markets were worst at −0.469R (t −3.17), and it beat 0.0% of random-date draws there. Bull and bear results were also negative, so the verdict is that it loses money.

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
Bull274−0.065R−0.66−0.39 · 214d−0.087R · beats 55%+0.128R
Flat93−0.469R−3.17−2.00 · 54d−0.068R · beats 0%−0.138R
Bear60−0.200R−0.980.15 · 32d+0.022R · beats 10%+0.094R
All427−0.172R−0.068R+0.055R

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.1 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
import math
from decimal import Decimal

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


class ExtremeOvernightGapAbsorptionLong:
    name = "extreme_overnight_gap_absorption_long"
    description = "Extreme negative overnight gap (<= -2 sigma of 60d overnight returns) absorbed intraday (close >= open), above 0.9x 200-SMA"

    def __init__(self, z_thresh: float = 2.0, std_lookback: int = 60, sma_len: int = 200, sma_discount: float = 0.10, atr_len: int = 14, stop_atr_buf: float = 0.25, target_atr_mult: float = 1.8, min_abs_gap: float = 0.015, structure_lookback: int = 20, min_rr: float = 1.5) -> None:
        self._z = z_thresh
        self._n = std_lookback
        self._sma_len = sma_len
        self._disc = sma_discount
        self._atr_len = atr_len
        self._buf = stop_atr_buf
        self._tmult = target_atr_mult
        self._min_abs_gap = min_abs_gap
        self._struct = structure_lookback
        self._min_rr = min_rr

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        need = max(self._sma_len, self._n + 2, self._struct + 2) + 20
        if len(bars) < need:
            return None
        cur = bars[-1]
        prev = bars[-2]
        pc = float(prev.close)
        o = float(cur.open)
        c = float(cur.close)
        lo = float(cur.low)
        hi = float(cur.high)
        if pc <= 0 or o <= 0 or c <= 0:
            return None
        gap = o / pc - 1.0
        if gap > -self._min_abs_gap:
            return None
        rets = []
        for i in range(len(bars) - 1 - self._n, len(bars) - 1):
            p = float(bars[i - 1].close)
            if p <= 0:
                return None
            rets.append(float(bars[i].open) / p - 1.0)
        m = sum(rets) / len(rets)
        var = sum((r - m) ** 2 for r in rets) / (len(rets) - 1)
        sd = math.sqrt(var)
        if sd <= 0:
            return None
        z = gap / sd
        if z > -self._z:
            return None
        if c < o:
            return None
        sma_v = sma([b.close for b in bars], self._sma_len)
        if sma_v is None:
            return None
        if c < float(sma_v) * (1.0 - self._disc):
            return None
        atr_v = atr(bars, self._atr_len)
        if atr_v is None or float(atr_v) <= 0:
            return None
        a = float(atr_v)

        entry = cur.close
        stop = Decimal(str(round(lo - self._buf * a, 6)))
        if stop <= 0 or stop >= entry:
            return None
        risk = entry - stop
        target = entry + Decimal(str(round(self._tmult * a, 6)))
        rr = (target - entry) / risk
        used_struct = False
        if rr < Decimal(str(self._min_rr)):
            # Wide-range absorption day: extend to the 1.5R level only if overhead
            # structure (pre-gap close or prior 20-day high) supports that distance.
            prior_high = max(float(b.high) for b in bars[-(self._struct + 1):-1])
            struct_level = Decimal(str(round(max(prior_high, pc), 6)))
            needed = entry + risk * Decimal(str(self._min_rr + 0.01))
            if needed > struct_level:
                return None
            target = needed
            rr = (target - entry) / risk
            used_struct = True
        if target <= entry or rr < Decimal(str(self._min_rr)):
            return None

        z_score = min(40, max(0, int((abs(z) - self._z) / 2.0 * 40) + 10))
        rng = max(hi - lo, 1e-6)
        close_pos = (c - lo) / rng
        gap_size = max(pc - o, 1e-6)
        recov = min(1.0, max(0.0, (c - o) / gap_size))
        absorb_score = min(35, max(0, int(close_pos * 15 + recov * 20)))
        vols = [float(b.volume) for b in bars[-21:-1]]
        avg_v = max(sum(vols) / len(vols), 1.0)
        vr = float(cur.volume) / avg_v
        vol_score = min(25, max(0, int((vr - 0.8) * 20)))
        strength = max(0, min(100, z_score + absorb_score + vol_score))

        thesis = (
            f"Overnight return {gap*100:.2f}% ({z:.1f} sigma vs 60d) from forced/auction selling; "
            f"session closed at or above the open (recovered {recov*100:.0f}% of gap, volume {vr:.1f}x avg), "
            f"showing liquidity providers absorbed the imbalance; expect reversion over coming sessions."
            + (" Target extended to 1.5R within prior structure due to wide range." if used_struct else "")
        )
        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,
            asset_class="equity",
        )

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