Course 8 Testing · Lesson 9 of 14

Backtesting and Forward Testing

Backtesting applies a strategy's rules to historical prices to see how it would have performed, and forward testing applies them to live prices, on a demo or with small size, to see how it performs now. A backtest shows whether an idea has ever worked; a forward test shows whether it works when you have to execute it. Both are needed, and a strategy that passes neither should not be traded with real money.

What you'll learn

  • Run a manual backtest without fooling yourself
  • Understand overfitting and out-of-sample testing
  • Design a forward test with a defined end

Manual backtesting

Scroll a chart back a year, hide the future, and step forward one bar at a time, taking every trade the rules require and recording it as if it were live. It is slow and it is the best education in the strategy you will get. Software can automate it for mechanical rules, and MetaTrader's strategy tester and TradingView's replay mode are the common tools, but the manual version teaches you what the rules feel like to follow.

Overfitting

Any rule set can be adjusted until it fits the past. The more parameters you tune and the more you look at the results while tuning, the more the strategy describes the noise of that particular period. The defence is to split the data: build on one period, test on another you did not look at. A strategy that performs similarly out of sample may have an edge; one that collapses was fitted.

What a backtest cannot tell you

  • Whether you can execute it: the test took every trade; you may not.
  • Realistic costs and slippage unless you add them, generously.
  • Regime change: a strategy built on a trending year may fail in a ranging one.
  • How it feels: a 20 percent drawdown on paper and on a live account are different experiences.

Forward testing

Trade the rules on a demo or with the smallest live size for a fixed number of trades, say fifty, or a fixed period, say three months, decided before you start. Record everything. At the end, compare the results with the backtest. If they are broadly similar, scale up gradually. If not, the difference is usually execution, costs, or a period unlike the one tested, and the journal will say which.

Key takeaways

  • Backtest bar by bar without seeing the future; automate mechanical rules with care.
  • Split data to detect overfitting.
  • A backtest cannot show execution, realistic costs or how it feels.
  • Forward test for a fixed sample decided in advance, then compare.

Knowledge check

  1. A strategy performs superbly on the data it was tuned on and poorly on the following year. What is the likely explanation?

Trading forex, CFDs and other leveraged products carries a high risk of losing money. This lesson is general education, not advice. Risk disclosure.

Cookie settings