Skip to main content

Backtesting Best Practices

Backtesting lets you see how a strategy would have performed on historical data. It's a critical step before going live — but it's also easy to get wrong.

What Backtesting Can Tell You​

One equity curve split into the data a strategy was tuned on and the data it had never seen. Two versions are drawn. The heavily optimised version is close to perfect in-sample and falls apart the moment the out-of-sample period begins. The simpler version is visibly worse in-sample and behaves roughly the same either side of the line, which is the property that actually matters.

A perfect backtest is evidence of overfitting. Real edges are modest and they travel.

  • Whether your strategy logic produces consistent signals
  • Rough expectations for win rate, average trade size, and drawdowns
  • How the strategy behaves in different market conditions (trending vs. ranging)

What Backtesting Cannot Tell You​

  • Future performance. Past results don't guarantee future returns.
  • Execution quality. Backtests assume perfect fills. Real markets have slippage, partial fills, and latency.
  • Emotional impact. A 20% drawdown looks fine on a chart. Living through one is different.

Common Mistakes​

Overfitting​

If you optimize 15 parameters to perfectly match 3 months of data, you haven't found a strategy — you've found a curve fit. It will likely fail on new data.

Rule of thumb: fewer parameters = more robust. A strategy with 2-3 inputs that works across multiple instruments and timeframes is more trustworthy than one with 10 inputs tuned to a single chart.

Survivorship Bias​

If you only test on instruments that are currently active and successful, you're ignoring all the ones that failed or delisted. This inflates your results.

Ignoring Transaction Costs​

Every trade has costs — commissions, slippage, spread. A strategy that makes $2 per trade on average but costs $3 in round-trip commissions is a losing strategy.

Testing on Too Little Data​

A strategy that looks great over 30 trades is statistically meaningless. Aim for at least 100+ trades across varying market conditions before drawing conclusions.

A Better Approach​

  1. Start with a hypothesis. "I believe momentum persists in ES futures on the 15-minute timeframe." Then build a strategy that tests that hypothesis.

  2. Use out-of-sample testing. Optimize on one time period, then validate on a completely separate period you didn't touch.

  3. Walk-forward analysis. Instead of one big backtest, test in rolling windows — optimize on months 1-3, test on month 4, then optimize on months 2-4, test on month 5, and so on.

  4. Sim before live. Even after backtesting, run the strategy on a sim account in real-time for at least 1-2 weeks. This catches issues backtesting can't — like alert timing, data feed differences, and connection reliability.

Next Steps​