Testing & risk
Backtesting without fooling yourself: look-ahead, overfitting and costs
A backtest answers “how would this fixed rule have done?”. Three mistakes make that answer look much better than reality.
Look-ahead bias
Using information that was not available at the time — a closing price before the close, a pattern derived from the same years it is tested on, revised data instead of first releases. The fix is discipline: every decision may only use what was known at that moment. Walk-forward testing builds this in.
Overfitting
With enough parameters, any history can be fitted perfectly — and the result will fail on new data. Fewer parameters, out-of-sample periods and results that hold across years and markets are the defences.
- Per-year results. A strategy that made all its money in one year is a story about that year.
- Parameter stability. Small changes in settings should not flip the result.
- Honest selection. If a parameter was chosen on the test period, say so.
Costs and execution
Spreads, commissions, swaps and slippage add up, especially for short-term strategies. A backtest without costs is an upper bound, not an estimate.
TakeawayA good backtest tells you how a rule behaved — including the years it failed. A perfect one usually tells you how the rule was fitted.
In Drift Engine
The Backtest Engine tests seasonal patterns walk-forward, lead-lag between markets, spread mean reversion and combinations, reports every metric next to buy-and-hold, evaluates results per year and says openly where a parameter was chosen on the tested period.
Educational content. Not investment advice and not a recommendation to buy or sell any financial instrument. Trading currencies involves a high risk of loss.