Skip to content
The Casebook · A classic strategy

Triple moving average, 4/9/18-day, long

Triple moving average: buy when the 4-day average is above the 9-day and the 9-day is above the 18-day; sell when that order breaks.
VerdictTested Nov 22, 2026

Loses money

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

  • −0.055R a trade after costs on the laggard stocks.
Trades on the laggards
3,537

42 large US stocks, 15 years

Per trade, after costs
−0.055R

Before costs +0.022R

Bar to clear
t > 2.01

By trade and by day, sized to a first try

What the numbers say

On the laggard stocks, 3537 trades averaged −0.055R after costs, versus 0.022R before costs, so costs account for the whole loss. Bull markets gave −0.060R (t −4.43) and flat markets −0.082R (t −3.10); only bear markets were positive at 0.041R, a result with t 1.06. Winners came in at 0.003R.

How it was tested

Buy at the close when the 4-day SMA is above the 9-day SMA and the 9-day SMA is above the 18-day SMA, and exit when that ordering breaks.

Side
Long
Its own exit
At any close after entry, exit at that close if SMA(4) <= SMA(9) or SMA(9) <= SMA(18) (the bullish ordering is broken)., 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 averages are simple moving averages of the daily close
  • Entry fires only on the first day the 4>9>18 ordering becomes true, not on every day it holds
  • 'Sell when that order breaks' is read as exiting the long, not opening a short
  • Stop and target are wide protective levels (3 x ATR and 6 x ATR) since the real exit is the order breaking
  • Time limit set to the 30-day maximum so the exit rule drives most trades

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,645−0.060R−4.43−3.59 · 1,524d−0.068R · beats 80%−0.009R
Flat596−0.082R−3.10−3.11 · 339d−0.072R · beats 25%+0.030R
Bear296+0.041R1.060.40 · 152d−0.048R · beats 100%+0.058R
All3,537−0.055R−0.067R+0.003R

R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 13.8 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 TripleSma4918TrendLong:
    name = "triple_sma_4_9_18_trend_long"
    description = "Long when SMA4 > SMA9 > SMA18 first forms; exit when ordering breaks."

    def __init__(self, fast: int = 4, mid: int = 9, slow: int = 18,
                 atr_period: int = 14, stop_mult: float = 3.0,
                 target_mult: float = 6.0) -> None:
        self._fast = fast
        self._mid = mid
        self._slow = slow
        self._atr_period = atr_period
        self._stop_mult = stop_mult
        self._target_mult = target_mult

    def _aligned(self, closes):
        f = sma(closes, self._fast)
        m = sma(closes, self._mid)
        s = sma(closes, self._slow)
        if f is None or m is None or s is None:
            return None
        return (f > m) and (m > s)

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        if len(bars) < max(self._slow + 1, self._atr_period + 1):
            return None
        closes = [b.close for b in bars]
        now = self._aligned(closes)
        prev = self._aligned(closes[:-1])
        if now is None or prev is None:
            return None
        if not now or prev:
            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="SMA(4) > SMA(9) > SMA(18) alignment first formed at today's close.",
        )

    def exit_now(self, ticker: str, bars: list[Bar], entry: Decimal,
                 side: str, bars_held: int) -> bool:
        if side != "buy":
            return False
        closes = [b.close for b in bars]
        f = sma(closes, self._fast)
        m = sma(closes, self._mid)
        s = sma(closes, self._slow)
        if f is None or m is None or s is None:
            return False
        return (f <= m) or (m <= s)

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
Triple moving average, 4/9/18-day, long: Loses money · EdgeProven