MT5 guide

Expert Advisor Tester: How to Use the MT5 Strategy Tester

The expert advisor tester in MT5 is the built-in Strategy Tester, which runs an Expert Advisor on historical prices with your chosen settings. Set the EA, symbol, timeframe, date range, modelling mode and deposit, press Start, then read the Results and Graph tabs. A run shows how the code behaved on past data, not what it will do next.

Trading forex and CFDs involves substantial risk of loss. Automation applies rules; it does not remove trading risk. Read our risk disclosure.

Key takeaways

What the expert advisor tester does

A single run starts the EA with the parameters you set and processes the history as if it were live. Optimisation runs the same EA many times with different parameter sets. This guide covers the single run, which is the step to learn first.

The tester then reports the trades, curves and statistics for that run. This page is a settings walkthrough, so it does not interpret the figures.

To learn how the EA itself is written and compiled, see expert advisor coding. For what the test evidence means, read how to verify a trading bot.

Open the tester and start a first run

  1. Open the Strategy Tester from the View menu. The help says keyboard shortcuts are listed next to the menu commands, so use the one shown on your build.
  2. Pick the Expert Advisor in the Expert field. You can also right-click the EA in the Navigator and choose Test.
  3. Set the Symbol and Timeframe. The symbol drives the OnTick() events, so it should match the chart the EA is attached to.
  4. Set the date range, deposit and leverage, then press Start on the Settings tab.
  5. Watch progress in the Journal tab. When the run ends, open the Result and Graph tabs.

A multi-currency EA needs its other symbols enabled first. Right-click Market Watch, choose Symbols, and enable the instruments it trades.

Settings for a first run

Use the settings below for a first single run. The help headings differ slightly from these labels, and labels can vary by build. The modelling field is called Tick generation mode in the help.

Strategy Tester settings for a first single run
FieldSet it toWhat it controls
ExpertThe EA you want to testThe program that receives OnTick() and other event calls.
SymbolThe symbol the EA is attached toThe instrument the test runs on. Multi-currency EAs also need their symbols enabled.
TimeframeThe chart period the EA expectsThe value returned by Period() and used in the EA’s own logic.
DateA fixed range you can nameTesting includes the start date and ends on the last tick of the day before the end date.
ForwardNo, for a first runSplits the range into a back test and a forward test. See the forward section below.
DelayNo Delay, for a first runAdds simulated time between an EA trade request and its execution.
ModellingA mode you can justify for the EAHow ticks are generated inside each bar. See the modelling section below.
Deposit and leverageThe balance and leverage you want to testStarting balance in the deposit currency, and the margin used by the test.
VisualizationOff for speed, on to watch tradesReplays trades on a chart in a separate window. Unavailable when optimisation is on.
OptimizationOffOff means one run with the inputs you have set.

The input parameters section holds the EA’s own settings. Change one thing at a time, and write down each change, so the result can be traced to it.

A concept settings panel lists the tester fields Expert, Symbol, Timeframe, Dates, Modelling, Deposit, Leverage and Forward. Arrows lead from the panel to two output cards, one labelled Report and one labelled Graph.
Concept diagram, not an app screenshot.

Modelling: how ticks are simulated

The Modelling field decides how the tester builds price movement inside each bar. The same EA can give different results under different modes, so choose the mode before you read any figure.

MT5 Strategy Tester modelling modes compared
Modelling modeTick sourceSpeedBest suited forKey blind spot
Every tick based on real ticksHistorical broker bid/ask ticks accumulated on the server (no interpolation)Slowest; first run downloads full tick historyScalping, tight stops, Gold EAs and spread-sensitive rulesDepends on broker tick history quality; still lacks live slippage, requotes and liquidity depth
Every tickSynthetic ticks simulated by the tester from one-minute bar dataSlowIntrabar logic when broker real-tick history is unavailableIntrabar tick path and spread spikes are generated rather than actual broker quotes
1 minute OHLCFour emulated prices (Open, High, Low, Close) per one-minute barFastInitial checks on higher-timeframe or swing trading bot algorithmsApproximates intrabar price movement; misses sub-minute stop-loss and take-profit ordering
Open prices onlySingle open price of each chart barFastestEAs coded to evaluate and trade strictly once on new bar openIgnores all intrabar price movement, trailing stops and mid-bar stop-loss hits

A fifth option, Math calculations, loads no price history and generates no ticks: only OnInit(), OnTester() and OnDeinit() run, margin control is skipped, and swap and commission are eliminated. The MT5 help advises using it only for rough mathematical parameter checks before validating trades in a tick-based mode.

A common error is choosing Open prices only for an EA that manages stops and targets on every tick. The result then describes a different EA from the one you will run.

Forward testing and delays

Forward testing keeps the latest part of your date range for a second run. The earlier part is the back test. The Forward options are:

The help says forward results are displayed on a separate Forward tab, and the forward start date is marked by a vertical line on the chart. Forward testing helps show whether settings chosen on one period still behave on a later one. The forward period is still past data, and it is not a live test.

Example (illustrative round numbers): a 4-year range with Forward set to 1/4 runs the first 3 years as the back test and the final year as the forward test.

The Delay field simulates the time between an EA’s trade request and its execution. The options are No Delay, Random Delay and Fixed Delay. Random Delay draws a value between 0 and 18 seconds, most often under 9. Fixed Delay uses a value you choose, and the platform can measure ping to the trade server to suggest one.

Delays apply only to trades the EA sends itself. Pending orders are delayed when they are placed, not when they execute.

Reading the report and graph

After a run, the Result tab holds the report. The help also calls the report view "Results". The Graph tab shows the balance curve in blue and the equity curve in green. The Testing Report help page defines the fields. The table below gives the short version.

Common report fields, what each measures and what it does not show
FieldWhat it measuresWhat it does not show
Total Net ProfitProfit or loss of the run in the deposit currencyWhether the EA will make money live
Profit FactorGross profit divided by gross lossHow often trades win, or how large the next loss will be
Balance Drawdown MaximalLargest fall from a local high of the balanceThe worst fall that could happen in future
Recovery FactorProfit divided by maximum drawdownWhether a drawdown of similar size will repeat
Expected PayoffAverage result of one dealHow reliable that average is on other data
History QualityShare of correct one-minute data in the rangeWhether your broker’s live feed matched the history

Example (illustrative numbers): gross profit of 15,000 and gross loss of 10,000 give a Profit Factor of 1.5. That is arithmetic on one run. It is not a target, and another period can give a different figure.

The bottom of the Graph tab shows the deposit load, which is margin divided by equity. A high load means the test account came close to its margin limits. With Visualization on, each trade is shown on its chart. Visual testing runs in a new window with its own charts, Market Watch and Toolbox. It is unavailable when optimisation is on, and it can only be performed on local agents. Trade details are in the Toolbox, and the EA’s messages are in the Journal.

Common mistakes and the limits of a test

A test cannot reproduce live slippage, rejected orders, news spikes or server outages the way a live account meets them. Treat a result as a historical check, review how different trading bot algorithms fail across regimes, and keep historical test figures separate from dated live signal records — as shown in the Quantum Titan MT5 setup and risk guide. The next steps are a demo run and a written record of what happened on it.

YO4X is a Windows desktop workspace for supported MetaTrader 5 strategies, bot configuration and trading journals. The current desktop workflow is gated to supported MT5 demo accounts, and live-money trading is not released. Keep your test settings in a trading journal next to the results.

Frequently asked questions

Do I need the Strategy Tester before a demo run?

It is not required, but it is a quick way to confirm that an EA loads, runs and handles your chosen range without errors. It can catch setup mistakes before a demo account is involved. A clean test still does not show how the EA will behave on demo or live.

Why does a test result differ from my demo account?

The tester replays history, while a demo account trades live quotes from its own server. Spread, execution, modelling mode, data quality and delay settings all differ between the two. Compare the Journal and the EA’s log to see where the runs part ways.

What is the difference between Every tick and Every tick based on real ticks?

Every tick simulates all ticks, so the price path is generated by the tester. Every tick based on real ticks uses tick history that brokers have accumulated, with no simulation. The real-tick mode is closer to live conditions, but its first run can take a long time to download data.

Which MT5 Strategy Tester modelling mode is most realistic for scalping or Gold EAs?

Every tick based on real ticks is the closest mode to historical broker quotes for scalping, tight stops and Gold EAs, because it replays stored bid/ask ticks and spread changes instead of interpolating ticks inside one-minute bars. Combine it with realistic execution Delay settings and verify how the strategy’s trading bot algorithms behave intrabar — or review a documented Gold setup such as the Quantum Titan MT5 setup and risk guide. Even real-tick mode cannot guarantee identical live fills.

Why do MT5 Strategy Tester backtests differ from live or demo forward trading even in real-tick mode?

Even at 100% real-tick history quality, a backtest cannot fully reproduce live order-book liquidity, negative slippage on market or stop orders, requotes, widened news spreads, changing broker swap or commission schedules, or real VPS network latency. Forward trading also faces new market regimes that past optimization passes never saw, especially for spread-sensitive Gold EAs and high-frequency trading bot algorithms.

Is a high profit factor enough to trust an EA?

No. Profit factor is one ratio from one period, and it says nothing about drawdown size, trade count, costs or behaviour in other conditions. Read it alongside the full report and any forward results, and do not treat any number as a target.

Can I test an EA I did not write?

Only test EAs you wrote, bought or licensed. The tester does not change any licence terms. Never use copies of paid products that you did not buy or license.

Keep reading

Sources: Strategy Testing - Algorithmic Trading, Trading Robots - MetaTrader 5 Help · Testing Report - Algorithmic Trading, Trading Robots - MetaTrader 5 Help

Trading forex and CFDs involves substantial risk of loss. Past performance and backtests do not guarantee future results. Read our risk disclosure before you trade.