The Intuition

Moving average crossover is arguably the oldest systematic trading rule. The logic is intuitive: a short-term moving average tracks recent price behaviour, while a long-term moving average reflects the slower underlying trend. When the fast average crosses above the slow average, momentum is turning positive — a trend has emerged. When it crosses below, momentum is deteriorating.

The historical evidence for MA crossovers predates modern finance. Brock, Lakonishok, and LeBaron (1992) studied simple moving average rules on the DJIA from 1897 to 1986, finding that they generated significant positive returns even after adjustment for risk. More recently, Faber (2007) showed that a simple 10-month MA rule applied to the S&P 500 produced Sharpe ratios close to the index while dramatically reducing drawdowns, cutting maximum drawdown from ~83% to ~26%.

The MA crossover is essentially a trend-filter: it positions you on the right side of the trend while filtering out high-frequency noise. By using the cross of two averages rather than one average with a fixed threshold, the rule adapts to the price level of the asset and generates fewer whipsaw trades than a single-average rule (which would trigger on every touch of the average).

Key assumptions: (1) Trends are persistent enough to be captured by the MA window — if mean reversion dominates (as in range-bound markets), the strategy generates many false signals. (2) The parameters (fast/slow windows) are chosen to match the typical trend duration in the market. A 10/50 day combination suits intermediate trends; a 50/200 day combination (the "Golden Cross") is used for long-term trend signals. (3) Transaction costs are low enough that the signals are tradeable profitably.

The strategy's Achilles heel is whipsawing: in choppy, sideways markets, the fast and slow averages constantly cross each other, generating many small losses that erode capital even when no single trade is catastrophic. This is why MA crossover strategies are most effective on liquid, trending instruments like equity indices, government bond futures, and major commodity futures.

The Math

Read this as a compact model summary: what the signal sees, what it ignores, and where fragility can creep in.

SMA_fast(t) = mean(Close[t-fast : t])
SMA_slow(t) = mean(Close[t-slow : t])

Signal(t) = +1  if SMA_fast(t) > SMA_slow(t)
          = -1  if SMA_fast(t) < SMA_slow(t)

Parameters

ParameterTypeDefaultDescription
fast int 10 Fast SMA window in trading days
slow int 50 Slow SMA window in trading days

Source Code

def run(ticker: str, start: str, end: str, **params) -> dict:
    fast = int(params.get("fast", 10))
    slow = int(params.get("slow", 50))
    cost_bps = float(params.get("cost_bps", 0.0) or 0.0)
    slippage_bps = float(params.get("slippage_bps", 0.0) or 0.0)
    oos_split_pct = float(params.get("oos_split_pct", 0.0) or 0.0)
    df = fetch_ohlcv(ticker, start, end)

    sma_fast = df["Close"].rolling(fast).mean()
    sma_slow = df["Close"].rolling(slow).mean()

    pos = pd.Series(0.0, index=df.index)
    pos[sma_fast > sma_slow] = 1.0
    pos[sma_fast < sma_slow] = -1.0

    return run_backtest(
        df,
        pos,
        ticker=ticker,
        start=start,
        end=end,
        strategy=METADATA["slug"],
        params={"fast": fast, "slow": slow},
        cost_bps=cost_bps,
        slippage_bps=slippage_bps,
        oos_split_pct=oos_split_pct,
    )

Further Reading

  • Faber, M. (2007). A Quantitative Approach to Tactical Asset Allocation. Journal of Wealth Management, 9(4), 69–79.
  • Chan, E. (2013). Algorithmic Trading, Ch. 2. Wiley.
  • Brock, W., Lakonishok, J. & LeBaron, B. (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. Journal of Finance, 47(5), 1731–1764.

When It Works / When It Fails

Works
  • Sustained trending markets with positive autocorrelation
  • Broad indices during multi-week directional cycles
  • Instruments with persistent serial price autocorrelation
Fails
  • Choppy, sideways markets producing whipsaw signals
  • Low-autocorrelation instruments with frequent reversals
  • Transition periods — most false signals concentrated here

Regime Fit

Bull / Calm or Normal vol
Best conditions: full 1.0 long exposure. Trend signal has the highest hit rate here.
Bull / Stressed vol
Scaled back to 0.75 long. Signal remains valid but vol-adjusted sizing applies.
Transition / any vol
0.0–0.35 range. No directional conviction; whipsaw rate is highest here.
Bear side
Mirrors Bull profile on short scale. Same logic applies in the opposite direction.

Compared to Alternatives

vs Donchian
MA Crossover compares smoothed SMA levels; Donchian fires on raw N-day price extremes. Crossover has more lag and fewer whipsaws.
vs MACD
MACD adds EMA divergence with a signal line; MA Crossover uses simple averages only. MACD is more configurable but requires more parameter choices.
vs TSMOM
TSMOM uses raw lookback return sign; MA Crossover uses SMA level ratio. Results are similar on broad indices but construction differs meaningfully.
Run This Strategy →