NeuroBacktest
Back to BlogStrategy

How to Backtest an SMA Crossover Strategy

June 25, 2026 7 min read

A complete guide to building and testing simple moving average crossover strategies on stocks and crypto.

The SMA crossover is the classic trend-following strategy. When a short-term moving average crosses above a long-term moving average, it signals potential upward momentum. When it crosses below, it suggests the trend may be reversing.

The Classic 50/200 Setup

The most well-known version uses the 50-day SMA and 200-day SMA. A "golden cross" occurs when the 50-day crosses above the 200-day — often interpreted as a long-term bullish signal. A "death cross" is the opposite.

Why It Works (Sometimes)

SMA crossovers capture sustained trends. They keep you in winning trades during strong bull markets and get you out during prolonged downturns. The downside is whipsaw in sideways markets, where price oscillates around the averages and generates repeated false signals.

Backtesting Parameters to Optimize

  • Short window (e.g., 10, 20, 50 days)
  • Long window (e.g., 50, 100, 200 days)
  • Asset selection and market regime
  • Stop-loss and take-profit rules

Run It in NeuroBacktest

Try: "Backtest SMA crossover 50/200 on SPY from 2018 to 2024." The engine returns total return, drawdown, Sharpe ratio, win rate, and a complete trade log.