Skip to content
The Casebook · An idea an AI invented

Short after intraday gains with overnight selling

Fire when the sum of 10-day open-to-close log returns exceeds +5% and the sum of 10-day close-to-open log returns is below -1.5%, and close is below its 10-day high. Enter short at close. Stop 2x ATR(14) above; target 2.5x ATR below.
Why the AI thought it might work

A stock whose 10-day gains come entirely intraday while overnight returns are negative shows daytime retail chasing met by overnight institutional distribution. Persisting overnight selling pressure leads to subsequent weakness as demand fades.

VerdictTested Nov 22, 2026

Loses money

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

  • −0.297R a trade after costs on the laggard stocks.
Trades on the laggards
2,200

42 large US stocks, 15 years

Per trade, after costs
−0.297R

Before costs −0.201R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

On laggard stocks the short lost 0.297R a trade after costs over 2200 trades, and 0.201R before costs, so costs were not the only drag. It lost in bull (−0.160R), flat (−0.284R) and bear (−0.639R) markets, and in flat and bear it beat 0.0% of random-date draws. Winners also lost, at −0.232R.

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
Bull1,242−0.160R−3.65−3.32 · 814d−0.147R · beats 45%−0.181R
Flat439−0.284R−4.08−5.23 · 269d−0.114R · beats 0%−0.260R
Bear519−0.639R−13.49−9.94 · 190d−0.271R · beats 0%−0.303R
All2,200−0.297R−0.169R−0.232R

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

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


class IntradayOnlyRunupOvernightGivebackShort:
    name = "intraday_only_runup_overnight_giveback_short"
    description = "Short when 10-day intraday log returns sum > +5% but overnight log returns sum < -1.5% and close is below the 10-day high"

    def __init__(self, window: int = 10, intraday_min: float = 0.05, overnight_max: float = -0.015, atr_period: int = 14, stop_buffer_atr: float = 0.25, min_stop_atr: float = 1.0, max_stop_atr: float = 2.0, target_atr: float = 2.5, min_rr: float = 1.6) -> None:
        self._w = window
        self._intra = intraday_min
        self._over = overnight_max
        self._atr_p = atr_period
        self._buf = stop_buffer_atr
        self._min_stop = min_stop_atr
        self._max_stop = max_stop_atr
        self._tgt = target_atr
        self._min_rr = min_rr

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        w = self._w
        if len(bars) < max(60, w + self._atr_p + 5):
            return None
        recent = bars[-(w + 1):]
        intra_sum = 0.0
        over_sum = 0.0
        for k in range(1, len(recent)):
            prev = recent[k - 1]
            b = recent[k]
            o = float(b.open)
            c = float(b.close)
            pc = float(prev.close)
            if o <= 0 or c <= 0 or pc <= 0:
                return None
            intra_sum += math.log(c / o)
            over_sum += math.log(o / pc)
        if intra_sum <= self._intra or over_sum >= self._over:
            return None

        current = bars[-1]
        window_bars = bars[-w:]
        high_10 = max(b.high for b in window_bars)
        if current.close >= high_10:
            return None

        atr_val = atr(bars, self._atr_p)
        if atr_val is None or float(atr_val) <= 0:
            return None
        a = Decimal(str(atr_val))
        entry = current.close
        if entry <= 0:
            return None

        # Structure-anchored stop: above the 10-day high plus a small ATR buffer,
        # bounded to [min_stop_atr, max_stop_atr] ATR from entry.
        stop = high_10 + Decimal(str(self._buf)) * a
        lo = entry + Decimal(str(self._min_stop)) * a
        hi = entry + Decimal(str(self._max_stop)) * a
        if stop < lo:
            stop = lo
        if stop > hi:
            stop = hi
        risk = stop - entry
        if risk <= 0:
            return None

        dist = Decimal(str(self._tgt)) * a
        min_dist = Decimal(str(self._min_rr)) * risk
        if dist < min_dist:
            dist = min_dist
        target = entry - dist
        if target <= 0:
            return None
        rr = (entry - target) / risk
        if rr < Decimal("1.5"):
            return None

        # Strength: divergence magnitude + overnight pressure + giveback from high + volume
        intra_score = min(30, max(0, int((intra_sum - self._intra) / 0.05 * 30)))
        over_score = min(30, max(0, int((self._over - over_sum) / 0.03 * 30)))
        giveback = float((high_10 - entry) / a)
        give_score = min(20, max(0, int(giveback / 1.5 * 20)))
        vols = [float(b.volume) for b in bars[-21:-1]]
        avg_vol = sum(vols) / max(len(vols), 1)
        vol_ratio = float(current.volume) / avg_vol if avg_vol > 0 else 1.0
        vol_score = min(20, max(0, int((vol_ratio - 0.8) * 20)))
        strength = max(0, min(100, intra_score + over_score + give_score + vol_score))

        thesis = (
            f"10d intraday log-return sum {intra_sum*100:.1f}% vs overnight {over_sum*100:.1f}%: "
            f"gains came only during the session while overnight gaps were net down, "
            f"suggesting off-hours distribution. Close is {giveback:.1f} ATR below the 10d high; "
            f"expecting weakness as daytime demand fades."
        )
        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 intraday gains with overnight selling: Loses money · EdgeProven