MT5 EA backtesting vs forward testing: what the Strategy Tester shows and what only a demo forward test can reveal
Backtesting shows how an MT5 EA's rules behaved on past data. A demo forward test shows how it behaves live. Here is what each reveals and where each falls short.

The short answer
In MT5 EA backtesting vs forward testing, the two methods answer different questions. A backtest in the MT5 Strategy Tester replays historical data to show how an expert advisor's rules would have behaved under simulated conditions. A demo forward test runs the same EA in real time on a live price feed, which exposes behavior a simulation cannot reproduce: actual spreads, requotes, connection drops, server timing and how the EA handles events it has never seen. Neither test predicts future results. Used together, they help you understand what an EA does and where its weak points are.
This article compares the two methods side by side. It does not cover how to read individual report fields or choose a modeling mode, because those topics have their own guides.
Automate this on MetaTrader 5
A MetaTrader 5 expert advisor with documented inputs, full backtest settings and clear risk limits.
What a Strategy Tester backtest can reveal
The Strategy Tester runs your EA against stored price history and generates trades as if the market were unfolding bar by bar or tick by tick. MetaQuotes documents the tester and its settings in the MetaTrader 5 Strategy Tester help.
A backtest is good at showing you:
- Rule logic. Does the EA open trades where its documented conditions say it should? Running a visual test on EURUSD M15 lets you watch entries and exits on the chart and compare them to the EA's description.
- Behavior across many regimes. You can cover years of data in minutes, including trending periods, ranges and volatility spikes that a short demo test would never reach.
- Input sensitivity. Changing one input, such as a stop distance or a time filter, and rerunning the same period shows how much the trade list changes.
- Risk mechanics. You can verify that lot sizing, maximum open positions and daily loss limits trigger as described. For background on those inputs, see MT5 expert advisor risk settings explained.
- Crude failure modes. An EA that opens unlimited positions, ignores stops or breaks on a weekend gap often shows it quickly in history.
The historical limitations of backtesting
Every backtest is a model, and models simplify. The main historical limitations to keep in mind:
- Tick data quality. If your broker's history lacks real ticks for the period, the tester generates them. MetaQuotes explains this process in its page on tick generation modes. Generated ticks may not match the true path of price inside a bar, which matters for EAs with tight stops or scalping logic. The MT5 Strategy Tester modeling options guide covers the modes in detail.
- Simplified execution. The tester fills orders according to its own rules. It does not reproduce queue position, partial fills, requotes or rejections the way a live server can.
- Spread and cost assumptions. Historical spread data may be averaged or fixed depending on your settings and the data available.
- No infrastructure. There is no internet outage, no terminal restart, no VPS reboot and no broker maintenance window in a backtest.
- Hindsight in your choices. If you tuned inputs on the same period you tested, the result describes the past you fitted, not the EA's general behavior.
A backtest tells you what the rules did on one version of history. It cannot tell you how the live environment will treat those rules.
What a demo forward test can reveal
A demo forward test means attaching the EA to a chart on a demo account and letting it trade in real time, without changing inputs, for a defined period. It is slow, but it captures things only a live feed produces:
- Real spread behavior. You see spreads widen at the rollover, around news releases and in thin hours, and you see whether the EA's maximum spread filter actually blocks trades.
- Server responses. Error codes, invalid stops, trade context busy messages and rejected orders appear in the Experts and Journal tabs. The guide to MT5 expert advisor log errors helps you read them.
- Timing and session effects. Broker server time, daylight saving shifts and session filters behave as they will in practice, not as the tester assumed.
- Operational robustness. Does the EA recover its open positions after a terminal restart? Does it duplicate orders after a reconnection? These questions only get answered when the environment is real.
- Behavior on new data. Every bar in a forward test is data the EA was not tuned on.
The limitations of demo forward testing
A demo forward test is closer to reality, but it is still not a live account:
- Demo execution can differ from live. Fills, slippage and liquidity conditions on a demo server may not match the live server of the same broker. Check with your broker how its demo environment executes orders.
- Small sample. A few weeks of trading might produce only a handful of trades on a slow EA, which is not enough to judge much beyond basic functioning.
- Limited regime coverage. A calm month on EURUSD tells you nothing about how the EA handles a high volatility week.
- No emotional pressure. Demo money removes the temptation to intervene, which makes the test cleaner but also less representative of how you will manage the EA with real capital.
Backtesting vs forward testing at a glance
| Aspect | Strategy Tester backtest | Demo forward test |
|---|---|---|
| Data | Stored history, real or generated ticks | Live price feed in real time |
| Speed | Years in minutes | Real time only |
| Execution | Simulated by tester rules | Demo server responses, errors and slippage |
| Spread | Historical or fixed, depends on data and settings | Live spread as quoted |
| Market regimes covered | Many, if history is long enough | Only what happens during the test |
| Infrastructure issues | None | Disconnections, restarts, server time, VPS behavior |
| Overfitting risk | High if inputs were tuned on the same data | Low, data is unseen |
| Main question answered | Do the rules behave as described across history? | Does the EA work correctly in a live environment? |
A practical workflow combining both
Here is a sequence you can follow with any MT5 EA, whether on EURUSD or a futures CFD such as an S&P 500 index contract.
- Define the test. Write down the symbol, timeframe, inputs or set file, account type and the period. Keep this note with your results.
- Run a visual backtest first. In the Strategy Tester, enable visual mode for a short period and confirm entries and exits match the EA's documented logic.
- Run a long backtest with your best available modeling. Prefer real ticks if your broker provides them for the period. Record the spread setting you used.
- Split the history. If you adjust inputs, adjust them on an earlier segment, then test the untouched later segment. MT5's forward option in the tester settings can help, so check the forward period options in your terminal's Strategy Tester settings tab.
- Start the demo forward test with identical inputs. Load the same set file. For uninterrupted running, the MT5 expert advisor VPS setup basics explain what must stay online.
- Log everything. Each week, export or note the trades and scan the Experts and Journal tabs for errors.
- Compare like with like. Run a backtest over the exact forward test dates and compare the trade lists. Missing trades, extra trades or different exit prices point to execution, spread or data differences worth investigating.
Step 7 is the most useful check in the whole process. Large differences between the backtest and forward test over the same dates are not necessarily a flaw in the EA, but they show you where the simulation and reality disagree. If you are starting from a ready-made robot, an MT5 expert advisor with documented inputs and set files makes this comparison easier because you know exactly which settings to reproduce in both environments.
How to interpret disagreements
- Trades in backtest but not in forward test: often a spread filter, trading hours, server time offset or a broker restriction. Check the logs first.
- Trades in forward test but not in backtest: possible tick data differences or conditions that depend on intrabar price paths.
- Same trades, different exit prices: slippage, spread at the moment of exit or stop handling.
- Errors only in forward test: permissions, minimum stop distances or volume steps. The MT5 expert advisor not placing trades checklist covers these.
Remember that automated trading carries real risk. The CFTC's Learn and Protect resources are worth reading before you move any EA to a funded account.
Conclusion
Backtesting answers whether an EA's rules behave as described across a wide sample of history, within the limits of the data and the tester's simulation. Demo forward testing answers whether the EA operates correctly in a live environment with real spreads, server responses and interruptions, within the limits of a demo server and a short sample. Use the backtest to understand the logic, the forward test to check the plumbing, and the comparison of both over the same dates to find where they disagree. If you want a documented robot to run through this workflow, the MT5 expert advisor from SierraOnShop comes with its inputs and set files described.
FAQ
How long should a demo forward test run?
There is no fixed duration. Aim for enough trades and enough varied market conditions to judge the EA's operation, which can mean several weeks for an active EA and several months for a slow one.
Can I forward test on a live account with minimum size instead of demo?
Yes, some traders do this to capture live execution. It carries real financial risk, so check your broker's minimum volume and be prepared to lose the capital involved.
Should I change inputs during a forward test?
Avoid it. Changing inputs mid-test breaks the comparison with your backtest. If you need a change, stop, document it and start a new forward test.
Does a good forward test mean the EA will keep performing?
No. A forward test describes behavior over the tested period only. Market conditions change, and no test predicts future results.
Run it in MetaTrader 5
Written by
Clement
Futures trader for more than seven years, specialized in order book and order flow scalping on US index futures, now building automated strategies. Founder of SierraOnShop.
More about the authorReady to run an expert advisor?
A MetaTrader 5 expert advisor with documented inputs, full backtest settings and clear risk limits.