Backtesting
Testing a strategy on past prices, and how to read what comes back.
- What is backtestingBacktesting means running a trading strategy’s exact rules over past prices to see which trades they would have taken.
- Backtest vs live resultsA backtest has to assume how each order would have filled.
- OverfittingOverfitting is tuning a strategy’s rules so closely to one stretch of past prices that they describe that stretch, not anything that carries on.
- Slippage and commissions in a backtestA backtest has to guess the price each order would have filled at, and what each trade cost.
- Walk-forward testingWalk-forward analysis tests a strategy on history it hasn’t seen, again and again.
- How many trades is enoughThere’s no single number of trades that’s enough.
- In-sample and out-of-sampleIn-sample is the part of the price history you use to build and adjust a strategy’s rules.
- Forward testing and replayForward testing means running a finished strategy on new prices as they happen, without changing it, and recording every trade.