What Is Backtest?
A backtest runs a defined trading strategy against historical price data to estimate how it would have performed in the past. Backtesting is essential for evaluating systematic strategies before risking real capital.
A good backtest includes:
- A clear rule-based strategy (entry, exit, position sizing — no ambiguity). - Realistic transaction costs (commissions, slippage, spread). - Out-of-sample testing — develop on one period, test on another. - Sufficient sample size — hundreds of trades minimum. - Awareness of survivorship bias (testing on currently-listed stocks ignores delistings). - Walk-forward analysis — re-optimize periodically to simulate real adaptation.
Common backtest mistakes:
- Over-fitting: tweaking parameters until backtest looks great. Out-of-sample performance is usually much worse. - Look-ahead bias: using information that wouldn't have been available at the time of the simulated trade. - Ignoring costs: strategies that work gross often don't work net.
A strategy with positive backtest expectancy is necessary but not sufficient. The real test is live trading with small size to verify the backtest extrapolates.
Related terms
- Expectancy — The average profit or loss per trade, given win rate and average win/loss size.
- Win Rate — The percentage of trades that close profitably out of total trades taken.
- Technical Analysis — Predicting future price movements by analyzing past price and volume data.