Skip to content
IDEAL FOREX logo IDEAL FOREX Strategy, Trust & Excellence

Automated Trading

Backtesting, Forward Testing, and Why the Two Answers Differ

Automated Trading 6 min read By IDEAL FOREX editorial team

A backtest and a forward test usually disagree, and the gap between them is information rather than an annoyance. What each can honestly tell you, how over-optimisation flatters the first, and why a demo account is closer than a backtest but still not live.

Every serious statement about a trading rule rests on a test, and every test answers a narrower question than people want it to. The gap between a backtest result and what the same rule does afterwards is not a defect to be argued away. Read properly, it is the most useful information in the whole exercise.

What a backtest is

A backtest replays a rule against stored historical prices and reports what would have happened. It is arithmetic over a fixed sample, and every input is a choice: the period, the data quality, the spread, the commission, the slippage model, the assumed fill on a gap, the treatment of weekends.

Because those inputs are choices, two honest people can test the identical rule and get materially different answers. A strategy whose edge is measured in a few pips per trade can be turned from profitable to loss-making by a slippage assumption alone, which tells you something about how fragile such edges are and how much of a published result belongs to the settings of the test rather than the merit of the idea.

The deeper limitation is that the rule was usually designed after seeing the period it is tested on. A backtest is therefore always partly an explanation of known data.

Curve fitting, in plain terms

Testing tools can search thousands of parameter combinations and report the best. Some of those combinations will look excellent by luck: the moving average length that happened to sit exactly where that particular market turned, in that particular year.

The tell is not a bad result, it is a brittle one. If a rule performs strongly at a stop distance of thirty pips and poorly at twenty-eight or thirty-two, the settings have almost certainly been fitted to the accidents of the sample rather than to a durable behaviour. This is why a reported result should be read alongside the sensitivity around it, and why we would rather publish the assumptions and a range than a single impressive number.

Out-of-sample and walk-forward

The standard answer to hindsight is to reserve data the rule never saw during construction. Tune on the first stretch, then report on the second with the settings untouched. If the second stretch is dramatically worse, the tuning was doing the work.

Walk-forward testing extends that idea by repeating it in rolling periods, which mimics the actual situation of a trader who must re-examine settings over time without knowing the next year in advance. It is more demanding than a single split and gives a more honest picture of stability.

What a forward test adds

Forward testing applies the rule to data arriving after the design work was finished, usually in a demo account in live conditions. It captures what a historical replay cannot: order routing delays, spread widening around announcements, requotes, connection drops, the platform's own handling of partial fills, and the human difficulty of leaving something alone while it loses.

It is still not live performance. Demo feeds are typically idealised, fills arrive instantly, and no money is at risk, so behaviour in a demo test reflects the rule rather than the trader's reaction to loss. Treat demo output as hypothetical for that reason, and be cautious with any account of a demo result that omits the costs.

How to read a published result

  • Look for the assumptions first. Spread, commission, slippage, instrument list, timeframe, and the years covered. Absent assumptions, the number means nothing.
  • Look for the losing stretch. Every rule has one; a report without it is not complete.
  • Ask whether the settings were chosen on the reported period.
  • Count the trades. Twenty trades cannot support a claim about consistency, whatever the total looks like.
  • Check that the sample covers more than one market regime, and note that identifying a regime is only possible afterwards.

A test is a description of a rule under stated conditions. That is worth a great deal, and it is a different kind of statement from a projection, which is what readers too often take it for.

Risk disclosure

Backtests, simulations and forward tests are hypothetical and are clearly limited by their assumptions. Past performance, tested or actual, does not indicate future results, and a rule that behaved well in a sample can behave badly outside it. Leveraged trading involves substantial risk of loss. This article is educational and does not recommend any strategy or product.

Other published articles we have recorded, most recent first.