Skip to content
The Casebook · An idea an AI invented

Weak close on wide range above 100-day average, long

Condition: close within the lowest 10% of the day's high-low range, the day's range is at least 1.5x the 20-day average range, and the close is above the 100-day SMA. Entry at latest close long. Stop 1.0x ATR(14) below close. Target 1.5x ATR(14) above close. Skip if the close is a new 20-day low.
Why the AI thought it might work

After a close in the bottom decile of the day's range, retail and stop-driven sellers who dumped into the close leave next-open prices dislocated; overnight market makers and dip-absorbing institutions buy the open, so the overnight leg of the return is positive following intraday-weak closes. The effect persists because intraday liquidity demanders pay a concession that is captured in the overnight window, and it shows in one stock's own open vs prior close vs close bars.

VerdictTested Nov 22, 2026

Loses money

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

  • −0.143R a trade after costs on the laggard stocks.
Trades on the laggards
566

42 large US stocks, 15 years

Per trade, after costs
−0.143R

Before costs −0.025R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

Across 566 trades on the laggard stocks the idea averaged −0.143R after costs (−0.025R before), so costs deepened a small loss. It was negative in bull (−0.057R), flat (−0.272R) and bear markets (−0.861R, t −4.57), and it beat none of the random-date draws in bear markets. The winners did better (0.064R), but the verdict rests on the laggards.

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
Bull428−0.057R−0.82−1.47 · 294d−0.068R · beats 65%+0.086R
Flat105−0.272R−2.09−0.96 · 65d−0.056R · beats 10%+0.020R
Bear33−0.861R−4.57−4.53 · 20d−0.101R · beats 0%−0.146R
All566−0.143R−0.068R+0.064R

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


class LowIbsRangeExpansionOvernightReversal:
    name = "low_ibs_range_expansion_overnight_reversal"
    description = "Wide-range day closing in bottom decile of range above 100-SMA; fade the close-auction selling concession overnight"

    def __init__(self, ibs_max: float = 0.10, range_mult: float = 1.5, range_lookback: int = 20,
                 sma_len: int = 100, atr_len: int = 14, min_stop_atr: float = 1.0,
                 low_buffer_atr: float = 0.25, max_stop_atr: float = 2.0, target_r: float = 1.6,
                 max_vol_mult: float = 3.0, low_lookback: int = 20) -> None:
        self._ibs_max = ibs_max
        self._range_mult = range_mult
        self._range_lookback = range_lookback
        self._sma_len = sma_len
        self._atr_len = atr_len
        self._min_stop_atr = min_stop_atr
        self._low_buffer_atr = low_buffer_atr
        self._max_stop_atr = max_stop_atr
        self._target_r = target_r
        self._max_vol_mult = max_vol_mult
        self._low_lookback = low_lookback

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        need = max(self._sma_len, self._range_lookback, self._low_lookback, self._atr_len) + 25
        if len(bars) < need:
            return None
        cur = bars[-1]
        high = float(cur.high)
        low = float(cur.low)
        close = float(cur.close)
        rng = high - low
        if rng <= 0 or close <= 0:
            return None

        # 1. Close in bottom decile of the day's range
        ibs = (close - low) / rng
        if ibs > self._ibs_max:
            return None

        # 2. Range expansion vs prior 20-day average range
        prior = bars[-(self._range_lookback + 1):-1]
        avg_rng = sum(float(b.high) - float(b.low) for b in prior) / len(prior)
        if avg_rng <= 0:
            return None
        rng_ratio = rng / avg_rng
        if rng_ratio < self._range_mult:
            return None

        # 3. Above 100-day SMA
        closes = [float(b.close) for b in bars]
        sma_val = sma(closes, self._sma_len)
        if sma_val is None:
            return None
        sma_val = float(sma_val)
        if sma_val <= 0 or close <= sma_val:
            return None

        # 4. Skip new 20-day closing low (breakdown, not dislocation)
        prior_lows = bars[-(self._low_lookback + 1):-1]
        if close <= min(float(b.close) for b in prior_lows):
            return None

        # 5. News / earnings proxy: skip extreme volume
        vol_prior = bars[-21:-1]
        avg_vol = sum(float(b.volume) for b in vol_prior) / len(vol_prior)
        if avg_vol <= 0:
            return None
        vol_ratio = float(cur.volume) / avg_vol
        if vol_ratio > self._max_vol_mult:
            return None

        # Also skip a large downside opening gap (overnight news already hit)
        prev_close = float(bars[-2].close)
        atr_val = atr(bars, self._atr_len)
        if atr_val is None:
            return None
        atr_f = float(atr_val)
        if atr_f <= 0:
            return None
        if prev_close - float(cur.open) > 1.5 * atr_f:
            return None

        # Adaptive stop: below the day's low with buffer, but never tighter than 1 ATR
        structural_risk = (close - low) + self._low_buffer_atr * atr_f
        risk_f = max(self._min_stop_atr * atr_f, structural_risk)
        if risk_f > self._max_stop_atr * atr_f:
            return None

        entry = cur.close
        risk = Decimal(str(round(risk_f, 6)))
        stop = entry - risk
        if stop <= 0 or risk <= 0:
            return None
        target = entry + Decimal(str(self._target_r)) * risk
        if not (stop < entry < target):
            return None
        rr = (target - entry) / (entry - stop)
        if rr < Decimal("1.5"):
            return None

        # Strength: close extremity, range expansion, trend cushion, volume sanity
        close_score = max(0.0, min(30.0, (1.0 - ibs / self._ibs_max) * 30.0))
        exp_score = max(0.0, min(30.0, (rng_ratio - self._range_mult) / 1.5 * 30.0))
        dist = (close - sma_val) / atr_f
        trend_score = max(0.0, min(25.0, dist / 4.0 * 25.0))
        if 1.0 <= vol_ratio <= 2.0:
            vol_score = 15.0
        elif vol_ratio < 1.0:
            vol_score = 15.0 * max(0.0, vol_ratio)
        else:
            vol_score = max(0.0, 15.0 * (self._max_vol_mult - vol_ratio) / (self._max_vol_mult - 2.0))
        strength = int(max(0, min(100, round(close_score + exp_score + trend_score + vol_score))))

        return Candidate(
            ticker=ticker,
            side="buy",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=strength,
            thesis=(f"Closed at {ibs:.0%} of a {rng_ratio:.1f}x-average range above the {self._sma_len}-SMA "
                    f"without a news-like volume spike ({vol_ratio:.1f}x); forced close-auction selling should "
                    f"be absorbed overnight. Stop {risk_f/atr_f:.2f} ATR below close (at least 1 ATR, below day low)."),
        )

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
Weak close on wide range above 100-day average, long: Loses money · EdgeProven