Skip to content
The Casebook · A classic strategy

Buy on 200-day average cross-up, sell on close below

Buy when the price crosses above the 200-day moving average and sell when it closes back below it.
VerdictTested Nov 22, 2026

Loses money

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

  • −0.052R a trade after costs on the laggard stocks.
Trades on the laggards
1,454

42 large US stocks, 15 years

Per trade, after costs
−0.052R

Before costs +0.017R

Bar to clear
t > 2.01

By trade and by day, sized to a first try

What the numbers say

Across 1454 trades on the laggard stocks, the idea averaged −0.052R a trade after costs, against 0.017R before costs, so costs turned a small edge negative. Bull markets were −0.057R and flat markets −0.067R; bear markets were 0.018R, too weak to offset them. The winners showed 0.038R.

How it was tested

Buy at the close when the stock crosses from below to above its 200-day simple moving average, and exit at the first close back below it.

Side
Long
Its own exit
Exit at the first close after entry where close < SMA(close, 200) computed through that day., checked at each close
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.01, by trade and by day, sized to a first try (one idea, tested once)
Prices
15 years of daily bars through 2026-11-20; judged 2026-11-22
Choices made where the idea was open
  • Moving average is a simple moving average of closes, 200 days
  • Cross up means prior close at or below the SMA and today's close above it
  • Sell means exit the long position; no short side is taken
  • Stop of 4 x ATR(14) and target of 12 x ATR(14) are wide protective choices because the idea's own exit is the SMA rule
  • Time limit of 30 trading days is the harness maximum, so long trend holds are cut off at 30 days

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,052−0.057R−3.19−3.25 · 796d−0.071R · beats 65%+0.035R
Flat268−0.067R−1.95−1.54 · 192d−0.049R · beats 35%+0.065R
Bear134+0.018R0.380.17 · 94d−0.091R · beats 100%+0.006R
All1,454−0.052R−0.069R+0.038R

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

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


class Sma200CrossUpExitOnCloseBelow:
    name = "sma200_cross_up_exit_on_close_below"
    description = "Long on close crossing above 200-day SMA; exit at first close below it."

    def __init__(self, sma_period: int = 200, atr_period: int = 14, stop_mult: float = 4.0, target_mult: float = 12.0) -> None:
        self._sma_period = sma_period
        self._atr_period = atr_period
        self._stop_mult = stop_mult
        self._target_mult = target_mult

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        if len(bars) < self._sma_period + 1:
            return None
        closes = [b.close for b in bars]
        sma_now = sma(closes, self._sma_period)
        sma_prev = sma(closes[:-1], self._sma_period)
        if sma_now is None or sma_prev is None:
            return None
        sma_now_d = Decimal(str(sma_now))
        sma_prev_d = Decimal(str(sma_prev))
        if not (closes[-1] > sma_now_d and closes[-2] <= sma_prev_d):
            return None
        atr_val = atr(bars, self._atr_period)
        if atr_val is None or atr_val <= 0:
            return None
        atr_dec = Decimal(str(atr_val))
        entry = bars[-1].close
        stop = entry - Decimal(str(self._stop_mult)) * atr_dec
        target = entry + Decimal(str(self._target_mult)) * atr_dec
        risk = entry - stop
        if risk <= 0 or stop <= 0:
            return None
        rr = (target - entry) / risk
        return Candidate(
            ticker=ticker,
            side="buy",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=50,
            thesis="Close crossed above the 200-day SMA from at-or-below the prior day.",
        )

    def exit_now(self, ticker: str, bars: list[Bar], entry: Decimal, side: str, bars_held: int) -> bool:
        if side != "buy":
            return False
        if len(bars) < self._sma_period:
            return False
        closes = [b.close for b in bars]
        sma_now = sma(closes, self._sma_period)
        if sma_now is None:
            return False
        return closes[-1] < Decimal(str(sma_now))

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 on 200-day average cross-up, sell on close below: Loses money · EdgeProven