How to Backtest a Trading Strategy Without Fooling Yourself

Almost every backtest that looks great is wrong in some way. Not fraudulent — just quietly broken by one of a handful of well-known mistakes that produce an equity curve that goes up and to the right in testing and falls apart the moment real money is on the line.
Lookahead Bias
This is the most common and the most dangerous because it's invisible unless you specifically check for it. It happens when your backtest uses information that wouldn't actually have been available at the time of the trade — like using a daily candle's close to trigger an intraday entry earlier in that same day, or calculating an indicator using a data window that technically includes future bars because of how your platform handles indexing.
The fix: manually trace 5-10 individual trades through your backtest logic bar by bar and confirm every piece of data used to make that decision existed at that exact timestamp.
Overfitting
If you're optimizing parameters — moving average lengths, RSI thresholds, stop distances — against the same dataset you're using to evaluate performance, you will eventually find a combination that fits the noise in that specific data, not a real edge. A profit factor of 2.5 from a strategy with 14 tunable parameters tested on 2 years of data is almost always overfit.
The fix: split your data. Optimize on one period (in-sample), then test the exact same parameters, unchanged, on a period the optimization never saw (out-of-sample). If performance falls apart out-of-sample, the edge was never real.
Survivorship Bias
If you're backtesting a stock-picking strategy using today's S&P 500 constituents projected backward, you're only testing companies that survived to today. Companies that got delisted, went bankrupt, or got removed for underperformance are missing from your data — which flatters the results. This matters less for futures/forex backtests but is a real problem for equity strategies.
Ignoring Slippage and Commissions
A strategy that takes 600 trades a year with a small average edge per trade can look profitable on paper and be a net loser once you apply realistic slippage and commission costs. Always backtest with costs included, using slippage assumptions on the pessimistic side — not the best-case fill you'd get on a good day.
A Practical Process
- Define the strategy rules completely before looking at any performance numbers.
- Split data into in-sample (development) and out-of-sample (validation) before you start.
- Include realistic slippage and commissions from day one, not as an afterthought.
- Walk-forward test if possible — re-optimize periodically on a rolling window rather than once on the whole history.
- Paper trade or trade small size live before scaling, because live execution always surfaces problems backtests can't model — psychology, latency, and real fills.
None of this guarantees a strategy works. It just filters out the strategies that only ever worked on paper.