3.3 Backtesting – done right
Backtesting means testing a strategy on historical prices. It is useful – but it is easy to fool yourself.
Five rules for an honest backtest
- Include all costs: spread, commission, overnight financing and slippage.
- Split the data. Build the strategy on one period, and test it on a period you have not seen.
- Test in different markets: rising, falling and sideways periods.
- Look at enough trades. Fewer than 100 trades tells you little.
- Look at the whole picture: the largest drawdown, the longest losing streak and how even the result is – not just the total profit.
Key figures to look at
| Key figure | What it tells you |
|---|---|
| Expectancy | What you make on average per trade, in money or R |
| Profit factor | Gross profits divided by gross losses. Above 1.3 is often a minimum after costs |
| Maximum drawdown | How far the account fell from a peak – can you live with it? |
| Number of trades | More trades give more reliable figures |
The backtest is always too optimistic
In real life you also get mistakes, technical problems, worse execution and your own emotions. Expect the result to be worse than in the test.
From the books: fresh data can only be used once
David Aronson’s book on evidence-based technical analysis has a rule worth remembering: out-of-sample data is only “out of sample” the first time. If you test, adjust the strategy and test again on the same data, that data has become part of the development.
Decide in advance what result would make you drop the idea. Then look once.
Key takeaways
- Include all costs, and test on data you did not use to build the strategy.
- Look at expectancy, profit factor, maximum drawdown and the number of trades.
- Real results are almost always worse than the backtest.
65% of retail investor accounts lose money when trading CFDs with this provider.