Skip to content
The Casebook · An idea an AI invented

Vol contraction near 60-day high, ATR stop and target

Realized vol (stdev of daily returns) over last 5 days is < 0.6x its value over the prior 15 days, price is above 50-day SMA, and close is within 8% of the 60-day high. Long at close. Stop = entry - 2*ATR(14). Target = entry + 3.5*ATR(14).
Why the AI thought it might work

Volatility-targeting and risk-parity funds cut exposure when realized vol rises and mechanically re-add as it normalizes. When 10-day realized vol drops sharply from a 20-day peak while price holds above a prior pivot, the incremental re-leveraging bid supports price over following weeks.

VerdictTested Nov 22, 2026

Survivorship mirage

It clears the bar on today's winners, the stocks everyone wishes they had bought, but not on the laggards, which is where hindsight can't help.

  • It clears the bar on today's winners but not on the laggards: the winners' own rise did the work.
Trades on the laggards
3,714

42 large US stocks, 15 years

Per trade, after costs
−0.025R

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 22 laggards, the 3714 trades averaged −0.025R after costs, against 0.169R on today's winners. In flat markets it came to −0.116R (t −2.56 by day); bull and bear were −0.009R and −0.010R. The edge shows only on the winners, hence the verdict.

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
Bull2,897−0.009R−0.39−0.38 · 1,347d−0.044R · beats 85%+0.186R
Flat539−0.116R−2.10−2.56 · 286d+0.001R · beats 5%+0.045R
Bear278−0.010R−0.14−1.58 · 154d+0.076R · beats 25%+0.202R
All3,714−0.025R−0.029R+0.169R

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

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


def _stdev(xs):
    n = len(xs)
    if n < 2:
        return None
    m = sum(xs) / n
    v = sum((x - m) ** 2 for x in xs) / (n - 1)
    return math.sqrt(v)


class VolTargetReleaseAfterDeclineLong:
    name = "vol_target_release_after_decline_long"
    description = "Realized-vol release after a vol shock and pullback, price holding pivot near highs above 50-SMA"

    def __init__(self, compress_ratio: float = 0.6, shock_ratio: float = 1.15,
                 near_high_pct: float = 0.08, min_pullback_pct: float = 0.03,
                 stop_atr: float = 2.0, target_atr: float = 3.5) -> None:
        self._compress = compress_ratio
        self._shock = shock_ratio
        self._near = near_high_pct
        self._pullback = min_pullback_pct
        self._stop_atr = stop_atr
        self._target_atr = target_atr

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        if len(bars) < 130:
            return None
        closes = [float(b.close) for b in bars]
        if any(c <= 0 for c in closes[-122:]):
            return None
        rets = [math.log(closes[i] / closes[i - 1]) for i in range(len(closes) - 121, len(closes))]
        # rets has 121 entries; last 5 = recent, prior 15 = shock window, older 100 = baseline
        recent = rets[-5:]
        prior = rets[-20:-5]
        base = rets[-120:-20]
        v5 = _stdev(recent)
        v15 = _stdev(prior)
        vb = _stdev(base)
        if v5 is None or v15 is None or vb is None or v15 <= 0 or vb <= 0:
            return None
        ratio = v5 / v15
        if ratio >= self._compress:
            return None
        shock = v15 / vb
        if shock < self._shock:
            return None

        current = bars[-1]
        close_f = closes[-1]
        sma50 = sum(closes[-50:]) / 50.0
        if close_f <= sma50:
            return None
        hi60 = max(float(b.high) for b in bars[-60:])
        if hi60 <= 0 or close_f < hi60 * (1.0 - self._near):
            return None

        # Decline: during shock window price pulled back from the 60-day high
        pivot_low = min(float(b.low) for b in bars[-20:-5])
        if pivot_low > hi60 * (1.0 - self._pullback):
            return None
        # Holds above the pivot: compression window made no new low
        recent_low = min(float(b.low) for b in bars[-5:])
        if recent_low <= pivot_low:
            return None

        atr_val = atr(bars, 14)
        if atr_val is None or float(atr_val) <= 0:
            return None
        atr_dec = Decimal(str(atr_val))
        entry = current.close
        stop = entry - Decimal(str(self._stop_atr)) * atr_dec
        target = entry + Decimal(str(self._target_atr)) * atr_dec
        if stop <= 0 or not (stop < entry < target):
            return None
        risk = entry - stop
        rr = (target - entry) / risk
        if rr < Decimal("1.5"):
            return None

        # Strength: compression depth, shock magnitude, proximity to high, close location
        comp_score = int(max(0.0, min(35.0, (self._compress - ratio) / self._compress * 70.0)))
        shock_score = int(max(0.0, min(25.0, (shock - self._shock) * 30.0)))
        dist = (hi60 - close_f) / hi60
        near_score = int(max(0.0, min(25.0, (1.0 - dist / self._near) * 25.0)))
        rng = float(current.high - current.low)
        cpos = (close_f - float(current.low)) / rng if rng > 0 else 0.5
        close_score = int(max(0.0, min(15.0, cpos * 15.0)))
        strength = max(0, min(100, comp_score + shock_score + near_score + close_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"Vol release: 5d realized vol {ratio:.2f}x prior 15d after a {shock:.2f}x vol shock; "
                    f"pullback pivot {pivot_low:.2f} held, close within {dist*100:.1f}% of 60d high above 50-SMA. "
                    "Vol-targeting re-leveraging bid expected to lift price over the coming weeks."),
        )

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
Vol contraction near 60-day high, ATR stop and target: Survivorship mirage · EdgeProven