Backtesting runs a strategy on historical data to estimate its real-world performance. The hard part is not the simulation — it's avoiding the many ways to fool yourself.
Common pitfalls:
- Look-ahead bias: using information that wouldn't have been available at the time. Daily data with timestamps after the close, restated fundamentals, survivorship-biased universes.
- Overfitting: tuning until the backtest looks good. The cure is true out-of-sample testing, walk-forward analysis, and being suspicious of any strategy with too many tuning knobs.
- Transaction costs: realistic estimates of bid-ask, market impact, slippage, and commissions. Many "edge" strategies vanish once costs are honest.
- Survivorship bias: using only currently-listed companies misses the failed ones whose returns mattered.
- Data snooping: testing dozens of variants until one looks great is a guaranteed false discovery.
A good rule: if a backtest looks too good, it probably is. Treat backtests as a screen, not a guarantee.