Skip to content
The Casebook · An idea an AI invented

Buy after six straight lower closes, ATR stop and target

Entry at latest close if the last 6 closes are each below the prior close, the cumulative 6-day decline is at least 1.5x ATR(14), and close is above the 252-day low by 5%+. Stop = entry minus 1.5x ATR(14). Target = entry plus 2x ATR(14). Skip if volume on the latest bar is below 0.7x its 20-day average.
Why the AI thought it might work

Stocks that close lower for six consecutive sessions typically reflect redemption-driven or stop-loss-driven selling by constrained holders rather than information. Liquidity providers demand a premium that is paid when the forced flow runs out. The streak is visible in one stock's closes, fires often across volatile and laggard names, and the rebound is a compensated liquidity premium, not a chart pattern.

VerdictTested Nov 22, 2026

Killed by costs

There is something there before trading costs; after them, too little is left to count (under 0.04R a trade).

  • +0.092R a trade before costs, −0.008R after the spread and the selection haircut.
Trades on the laggards
268

42 large US stocks, 15 years

Per trade, after costs
−0.008R

Before costs +0.091R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

On the 22 laggards it averaged 0.092R a trade before costs and −0.008R after, across 268 trades, so costs erase the edge. Bull markets showed 0.034R, flat −0.085R and bear −0.089R. The after-cost result is below zero, which fits 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
Bull176+0.034R0.330.23 · 149d−0.086R · beats 85%+0.117R
Flat60−0.085R−0.45−0.82 · 48d−0.013R · beats 40%−0.076R
Bear32−0.089R−0.35−0.06 · 13d+0.017R · beats 35%+0.126R
All268−0.008R−0.057R+0.060R

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.0 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
from scanners.base import Candidate


class SixDayDownStreakExhaustion:
    name = "six_day_down_streak_exhaustion"
    description = "Long on the 6th consecutive lower close (>=1.5 ATR decline, 5%+ above 252d low, volume >=0.7x avg) betting forced selling is exhausted."

    def __init__(self, streak_len: int = 6, min_decline_atr: float = 1.5, low_buffer_pct: float = 0.05, min_vol_ratio: float = 0.7, base_stop_atr: float = 1.25, max_stop_atr: float = 1.5, swing_buffer_atr: float = 0.25, base_target_atr: float = 2.0, retrace_frac: float = 0.5, min_rr: float = 1.6) -> None:
        self._n = streak_len
        self._min_decline_atr = min_decline_atr
        self._low_buffer = low_buffer_pct
        self._min_vol_ratio = min_vol_ratio
        self._base_stop_atr = base_stop_atr
        self._max_stop_atr = max_stop_atr
        self._swing_buf = swing_buffer_atr
        self._base_target_atr = base_target_atr
        self._retrace = retrace_frac
        self._min_rr = min_rr

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        n = self._n
        if len(bars) < 260:
            return None
        closes = [b.close for b in bars]
        # Exactly n consecutive lower closes (fires once per streak)
        for k in range(1, n + 1):
            if not (closes[-k] < closes[-k - 1]):
                return None
        if closes[-n - 1] < closes[-n - 2]:
            return None
        current = bars[-1]
        entry = current.close
        if entry <= 0:
            return None

        atr_raw = atr(bars, 14)
        if atr_raw is None or float(atr_raw) <= 0:
            return None
        a = Decimal(str(atr_raw))

        pre_streak_close = closes[-n - 1]
        decline = pre_streak_close - entry
        if decline < Decimal(str(self._min_decline_atr)) * a:
            return None

        low_252 = min(b.low for b in bars[-252:])
        if entry < low_252 * (Decimal("1") + Decimal(str(self._low_buffer))):
            return None

        prior_vols = [float(b.volume) for b in bars[-21:-1]]
        avg_vol = sum(prior_vols) / len(prior_vols)
        if avg_vol <= 0:
            return None
        vol_ratio = float(current.volume) / avg_vol
        if vol_ratio < self._min_vol_ratio:
            return None

        # Stop: at least base_stop_atr below entry, pushed below the streak low
        # (minus a small buffer) if that is lower, but never wider than max_stop_atr.
        streak_low = min(b.low for b in bars[-n:])
        stop_base = entry - Decimal(str(self._base_stop_atr)) * a
        stop_struct = streak_low - Decimal(str(self._swing_buf)) * a
        stop = min(stop_base, stop_struct)
        stop_floor = entry - Decimal(str(self._max_stop_atr)) * a
        if stop < stop_floor:
            stop = stop_floor
        risk = entry - stop
        if risk <= 0 or stop <= 0:
            return None

        # Target: partial retrace of the streak, at least base_target_atr,
        # and at least min_rr * risk.
        reward = max(Decimal(str(self._base_target_atr)) * a, Decimal(str(self._retrace)) * decline)
        min_reward = Decimal(str(self._min_rr)) * risk
        if reward < min_reward:
            reward = min_reward
        target = entry + reward
        rr = (target - entry) / risk
        if rr < Decimal("1.5"):
            return None

        # Strength: depth of flush, volume (capitulation), close off the lows
        depth_atr = float(decline / a)
        depth_score = min(40, max(0, int((depth_atr - self._min_decline_atr) * 12) + 10))
        vol_score = min(30, max(0, int((vol_ratio - self._min_vol_ratio) * 25)))
        rng = current.high - current.low
        if rng > 0:
            close_pos = float((current.close - current.low) / rng)
        else:
            close_pos = 0.0
        close_score = min(30, max(0, int(close_pos * 30)))
        strength = max(0, min(100, depth_score + vol_score + close_score))

        thesis = (
            f"{n} straight lower closes, down {depth_atr:.1f} ATR from {pre_streak_close}, "
            f"volume {vol_ratio:.2f}x avg, still {float(entry / low_252 - 1) * 100:.0f}% above 252d low. "
            f"Forced/constrained selling likely exhausted; liquidity premium should be repaid via a partial rebound. "
            f"Stop {float(risk / a):.2f} ATR below entry, target {float(reward / a):.2f} ATR above."
        )
        return Candidate(
            ticker=ticker,
            side="buy",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=int(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
Buy after six straight lower closes, ATR stop and target: Killed by costs · EdgeProven