Academy

Backtesting · 1 min read

How to Backtest a Trading Strategy

A structured way to test written rules on historical data without fooling yourself.

Course · 3 lessons · 9 minAnimated explainers, quizzes and chart exercisesStart course

Backtesting applies a fixed set of rules to past market data to see how they would have behaved. It describes the past; it cannot guarantee how the rules will perform in the future.

1. Write the rules first

Define entry, stop, target, position size, sessions and markets before you look at a chart. If a rule needs judgement, describe what you will look for.

2. Hide the future

Use bar-by-bar replay so you only see what was known at the time. Scrolling back over a finished chart makes winning setups look obvious.

3. Collect enough trades

A handful of trades says very little. Aim for a meaningful sample across different market conditions before drawing conclusions.

4. Review, then change one thing

Look at expectancy, drawdown and the distribution of R-multiples. If you adjust a rule, re-test it on data you have not used yet to avoid curve-fitting.