Skip to content
XauStack

How to forward test a gold EA on a demo account

Updated6 min read

Strategy TesterBacktestingMetaTrader 5

Fix the setup and the length of the demo test before the first trade, log as you go, then replay the same dates in the Strategy Tester and compare the two runs trade by trade.

  • A demo forward test is worth most when you replay the same dates in the Strategy Tester afterwards and compare the two runs trade by trade.
  • Spread, fill prices, swap and the server clock explain gaps you should expect. Missing trades, extra trades and errors in the log are warnings.
  • Fix the length, the setup and the log before the first trade, not after the results.

“Live beats backtest” is common advice about Expert Advisors, and it is half right. A demo account in real time shows what no replay can: your broker’s quotes as they arrive, your terminal’s restarts, the EA’s own errors. But demo results alone prove little. This guide holds them up against a Strategy Tester run over the same dates.

It is not MetaTrader’s Forward option, which holds back part of a historical window during optimization; curve fitting and MT5 forward tests covers it.

What a demo account can and cannot show

MetaQuotes describes demo accounts plainly: “They feature all the same functionality as the live ones. The difference is that demo accounts can be opened without any investment and, therefore, one cannot expect to profit from them” (MetaTrader 5 Help). That makes a demo useful for testing software, but its fills are not what a real account gets, and its result is not a track record.

Before the first trade: fix the setup

Write these down and keep them fixed:

  • the broker, server and symbol, with its suffix;
  • the account’s position accounting (netting or hedging);
  • the deposit and leverage you will trade live;
  • the preset, loaded from the file and saved again under a dated name;
  • the machine: your PC or the VPS you will use live.

For one of our Products there is one more step. The free Backtest Edition runs only in the Strategy Tester, so a demo forward test needs a licensed build. The licence is bought before that build is made, and a delivered build is not refunded (see the refund policy). So with one of ours the demo test comes after you pay; before you pay, the Backtest Edition in the Strategy Tester is the test available. A build runs only on the logins it was compiled for: up to two, live or demo, given at checkout. To forward test first, name the demo login and the live login together. A login added later is a new licence.

How long to run it

Use two gates, and set both before you start: a number of calendar weeks and a number of closed trades. Stop only when both are met.

Take the trade count from the EA’s own Strategy Tester report: an EA that trades several times a day reaches it within weeks, one that trades a few times a month needs months. Whatever the count, include at least one triple-swap night and one major US release, because a release is where a tester fill and a real one part most. Gold EAs and NFP, CPI and FOMC lists them.

Log it as you go

The Experts tab of the Toolbox “contains information about the running indicators and Expert Advisor, including opening/closing of positions, modification of orders, Expert Advisor alerts and comments”. Its files are kept by day: “Expert log files are saved in MQL5\Logs. File names correspond to the date of journal generation — YYYYMMDD.LOG”, while the “Journal” tab “only contains the latest entries” (MetaTrader 5 Help, Platform Logs). Copy those files out once a week.

Beside them, note every restart, disconnection, terminal update, VPS move or settings change, with date and time. At the end, save the account statement: “select ‘Report’ in the context menu of the History tab” (MetaTrader 5 Help, Trading Report). Its Deals block lists every trade with its price and time.

Replay the same dates in the Strategy Tester

When both gates are met, run the tester over the demo test’s exact dates, on the same symbol, deposit, leverage and preset. Choose Every tick based on real ticks: “Testing is performed using real ticks of financial instruments, accumulated by brokers. No simulation is performed” (MetaTrader 5 Help, Strategy Testing). Run it twice, once with No Delay, which MetaQuotes calls “‘ideal’ conditions”, and once with Random Delay, “conditions maximally close to real ones” (same page).

Then pair the trades: tester deals against demo deals, by entry time and direction. Run with visualization on and the tester opens its own Toolbox, which “displays trade operations performed by an Expert Advisor during testing” (MetaTrader 5 Help, Testing Visualization). The report’s Entries by hours diagram, which “shows the distribution of market entry deals … by hours” (MetaTrader 5 Help, Testing Report), gives a quick first check against the demo’s entry times.

Differences you should expect

  • Fill prices. The demo was filled by your broker’s server; the tester decided its own fills. Small differences on most trades, and larger ones around news, are normal.
  • Spread and cost. Check what the tester charged against the demo’s statement. Why backtests differ from live explains the commission and spread gaps and how to measure them.
  • Swap. Positions held overnight pay or earn swap, and the symbol’s specification sets a “swap multiplier for each day of the week” (MetaTrader 5 Help). Check the triple-swap day falls on the same date in both.
  • The clock. In the tester, “the local time TimeLocal() is always equal to the server time TimeTradeServer(). In turn, the server time is always equal to the time corresponding to the GMT time - TimeGMT()” (MQL5 Reference). Live, those three clocks differ by your broker’s offset. If every trade is shifted by the same whole number of hours, that is the reason. Ask the seller which clock the EA reads.

Differences that are warnings

  • A trade in one run with no partner in the other, beyond a near miss at the edge of a signal.
  • A different direction, or a different lot size at the same balance.
  • Errors in the Experts log: rejected orders, invalid stops, not enough money.
  • Hours when the EA was not running and your own note does not say why.
  • A demo drawdown deeper than the tester’s over the same dates by more than the cost gap explains.

Each is a question for the seller before live money is involved.

When you switch to live

MetaTrader 5 can stop EAs when the account changes: the option “Disable automated trading when switching accounts” is “useful, for example, when switching from a demo account to a real one” (MetaTrader 5 Help, Settings). Keep the same log live, and compare its first weeks with the tester the same way.

Before you act on any of this

Every figure XauStack publishes comes from the MetaTrader 5 Strategy Tester, never from live trading, and no result is promised anywhere on this site. A demo test that matches the tester shows the software behaves as tested. It does not show that the strategy will make money. Read the risk disclosure before you move to a funded account.

All guides

Book a call