Backtesting a forex strategy
Backtesting applies your written rules to historical prices and records what would have happened. It is only useful if the rules are specific enough to apply the same way every time, and if the test is honest about costs and sample size.
Before you start
- Write the rules in your trading plan first. Do not adjust them while you look at results.
- Choose the data source and timeframe, and note any gaps or quirks in the data.
- Decide which costs to include: spread, commission and an allowance for slippage.
Record every trade
Log every signal the rules produce, including the losers and the trades you would have skipped in real life. Note the date, entry, stop, target, result in pips and the result in R (multiples of your risk). A test that keeps only the trades you like is not a test.
Watch for overfitting
If you tune the rules until the historical curve looks good, you have fitted the strategy to past noise. Warning signs include many parameters, rules changed after seeing results, and a result that depends on one or two periods. Test the final rules on data you did not use to design them, and treat a small sample as uncertain rather than as proof.
Read the results with their limits
A backtest shows how the rules behaved on one data set under one set of assumptions. It does not show what will happen next. Live trading adds slippage, missed fills and emotional decisions that a test does not capture. Simulated and backtested results do not guarantee future results.
The Sigma Trader's 12-week Traderpreneur programme covers writing a plan, fixed risk and reviewing trades. See the programme.
Risk warning: Trading foreign exchange on margin carries a high level of risk and may not be suitable for all investors. You could lose more than your initial deposit. This page is education only and is not financial advice. Simulated and backtested results do not guarantee future results.