What is backtesting?

What backtesting a strategy means, how a backtest is built, the common biases that make backtests look better than reality, and how to use results wisely.

What it is

A backtest applies a strategy's rules to past data, day by day or month by month, as if you had followed them in real time. It shows how the rules would have performed, including returns, drawdowns and trades.

How one is built

  1. Define the rules exactly.
  2. Choose the period and the universe of investments.
  3. For each date, use only data that was available on that date.
  4. Record trades, including costs.
  5. Measure results: CAGR (compound annual growth rate), Maximum drawdown, Sharpe ratio and others.

Common biases

Bias What goes wrong
Look-ahead Using data not yet known on that date, such as earnings before they were reported
Survivorship Testing only companies that still exist, missing those that failed
Overfitting Rules tuned to past noise. See Overfitting in investing
Cost Ignoring spreads, slippage and taxes. See Portfolio turnover
Period A window that happened to suit the strategy

Using backtests wisely

A backtest is a way to reject bad ideas, not to prove good ones. If a rule fails in a backtest, it probably fails in reality. If it succeeds, it has only passed the first test. Next: Out-of-sample testing and How to read a backtest.

See also

Last updated September 30, 2026. Education only, not investment advice.