Practical guide

How to backtest in MetaTrader 5, step by step (Strategy Tester)

Published October 30, 2026 · By the AUREUM team · 10 min read

To backtest in MetaTrader 5, open the Strategy Tester (View → Strategy Tester or Ctrl+R), choose the Expert Advisor, the symbol, the timeframe and the dates, set the modelling to “Every tick based on real ticks”, enter your account’s deposit and leverage, and click Start. Clicking the button is the easy part; the hard part is making the simulation look like the real market. Here is every setting, and the mistakes that distort a backtest the most.

Before you start: the robot and your broker’s price history

The tester only sees robots in the MQL5 ▸ Experts folder, the ones listed in the Navigator under Expert Advisors; if yours isn’t there yet, follow how to install an Expert Advisor in MetaTrader 5. In the tester, the robot trades a simulated deposit: it doesn’t send any orders to your account.

Prices come from your broker’s server, and the tester downloads them when it starts. To see how far back they go, open View → Symbols (Ctrl+U), go to the Ticks tab, pick the symbol and a date range, and click Request. If the ticks start two years ago, a five-year backtest will only have real ticks for the last two. The first download takes a while: ticks take up far more space than one-minute bars.

How to backtest in MetaTrader 5, step by step

With MT5 open and logged in to your account, live or demo:

  1. Open the tester. Go to View → Strategy Tester or press Ctrl+R (on a Mac too, where MT5 shortcuts use Ctrl; see MetaTrader 5 on Mac), or right-click the robot in the Navigator and choose Test. For a first backtest, stay on the Settings tab.
  2. Robot, symbol and timeframe. Under Expert, pick your Expert Advisor; then the symbol and the timeframe: for gold, your broker’s XAUUSD (it may be called GOLD or carry a suffix), and the timeframe the robot asks for, H1 for example.
  3. Dates. Under Date, choose a preset range (last year, entire history…) or “Custom period”. Before the start date, the tester loads enough history to build at least 100 bars; if there isn’t enough, it moves the start later and notes it in the Journal.
  4. Modelling. For the result that counts, “Every tick based on real ticks”; the modes are covered in the next section.
  5. Deposit and leverage. Under Deposit, enter the amount and the currency (your account’s by default) and, next to it, the leverage. Use what you’ll really have: a robot that sizes its lots from the balance doesn’t trade the same way with 1,000 as with 100,000, and the leverage you get on gold depends on your broker’s regulator: 1:20 for retail clients in the EU and the UK (see gold leverage). Leave “profit in pips” unticked: it doesn’t calculate swaps or commissions.
  6. Delays. “Zero latency, ideal execution” fills every order at the requested price, which doesn’t happen in a live account. Run the test again with “Random delay” or a custom delay in milliseconds (MT5 shows your last ping to the server).
  7. Inputs and start. The Inputs tab holds the robot’s settings: use the ones its developer recommends. With optimization disabled, click Start.

The results show up in the Backtest tab (the report), the Graph tab (balance and equity) and the Journal tab (messages from the robot and the tester).

Visual mode: watch the robot trade

If you tick Visualization, you watch the robot trade candle by candle on a chart, with its indicators and orders: the best way to check that it respects its stop and doesn’t open trades at odd hours. It can’t be used for optimization, it only runs on local agents, and you can’t change that chart’s timeframe.

Strategy Tester modelling modes: which one to use

The modelling decides which prices the robot sees inside each candle, and it’s the setting that changes the result most when the robot uses tight stops or a trailing stop: when a candle touches both the stop and the target, only real ticks tell the tester which came first; the other modes infer it from the bars. These are the modes:

ModeWhat it does and when to use it
Every tick based on real ticksReplays the ticks your broker recorded, with their variable spread. According to MetaQuotes, it’s the closest to real conditions. The test that counts. It’s slow, and the first run downloads every tick in the period.
Every tickGenerates ticks inside each one-minute bar, with a fixed spread for each minute. It’s the most accurate and the slowest of the modes that generate prices. For periods with no real ticks in your broker’s history.
1 minute OHLCAt most four prices per one-minute bar: open, high, low and close. For screening ideas and optimizing fast, if the robot doesn’t care what happens inside the minute.
Open prices onlyThe robot only acts at the open of each bar on the chosen timeframe. Stops and pending orders may fill at a price other than the one set. For quick, rough checks. Random delay isn’t available.

The fifth mode, “Math calculations”, loads no prices and generates no ticks: it’s no use for a trading backtest. The rule of thumb: fast modes are for ruling ideas out, and when they disagree with real ticks, real ticks win. And even if you choose real ticks, the minutes where your broker has no ticks, or where they don’t match the one-minute bars, are generated as in “Every tick”.

Inputs, optimization and forward testing in the tester

Optimizing means rerunning the backtest with many combinations of inputs. On the Inputs tab, tick each input you want to vary and set its start value, step and stop value. Then, back on Settings, choose the type under Optimization:

The combinations appear in the Optimization Results and Optimization Graph tabs. How MT5 spreads the work across cores and agents is covered in MetaTrader 4 vs MetaTrader 5; whether the best combination is genuinely good or just fits that stretch of the past (overfitting), in backtesting and overfitting.

Forward testing inside the tester

The Forward setting holds back the end of the date range: half, a third, a quarter, or everything from a date you choose. During optimization, the tester searches for inputs in the first part and runs the best combinations through the second, which they never saw; their results appear in the Forward tab. If they collapse there, the inputs were tailored to the past. It doesn’t replace testing the robot in today’s market: see demo or live account.

Checking the backtest report: settings and history quality

Before you look at how much the robot made, check in the report on the Backtest tab that the symbol, timeframe, dates, deposit and leverage are the ones you set, and look at History Quality. With real ticks, the report shows it as a percentage of “real ticks” (for example, “100% real ticks”), but it doesn’t measure how much of the period was tested on them: MetaQuotes calculates it from one-minute data, comparing correct bars with incorrect ones (gaps count as incorrect). A 100% doesn’t guarantee that the whole period was tested on real ticks; the Journal flags the generated minutes with messages such as “real ticks absent…” or “real ticks discarded…, every tick generation used”.

Then come the metrics (net profit, profit factor, drawdown, number of trades), which you read together: we explain them in how to read the Strategy Tester report and in what is drawdown.

Common mistakes that distort a MetaTrader 5 backtest

The AUREUM backtest: what it publishes

AUREUM is an Expert Advisor for gold (XAU/USD) in MetaTrader 5. Its homepage publishes the MT5 Strategy Tester report on XAU/USD history from 2020 to 2026, on H1 and with real spreads: 439 trades, a profit factor of 1.49 and a maximum drawdown on balance of 21.84%, from $5,000 to $25,524 in the simulation. It’s a backtest, not a live account. According to the homepage, the strategy was also validated with Monte Carlo and Walk-Forward on periods it didn’t use during its creation.

What you’ve seen here helps you read that report, or any other, with the right questions: what spread it was run with, how many trades are behind it and how far it fell. As its legal notice points out, actual performance may differ due to slippage, commissions, spreads, latency and broker conditions.

Frequently asked questions about backtesting in MetaTrader 5

How do you open the Strategy Tester in MetaTrader 5?

From the View → Strategy Tester menu or with Ctrl+R, on a Mac too. You can also right-click the robot in the Navigator and choose Test: the tester opens with that Expert Advisor already selected.

Which modelling mode is the most reliable in MT5?

“Every tick based on real ticks”, which replays the ticks your broker recorded, variable spread included. It’s slow (the first run downloads every tick in the period), and if your broker is missing the ticks for a minute, or they don’t match its one-minute bars, the tester generates that minute as in “Every tick”.

Does the Strategy Tester charge commissions?

It can, but check. In “Trade Settings” (the button next to Delays), Commissions tab: with “Use custom settings” unticked, your account’s commissions apply; tick it and the ones you enter apply instead. If you tick “profit in pips”, neither commissions nor swaps are calculated.

What is forward testing in the Strategy Tester?

It sets aside the last part of the period (1/2, 1/3, 1/4 or from a date) to check the optimized inputs on data they didn’t see during optimization. If the result collapses in that stretch, the inputs were tailored to the past.

What deposit and leverage should I set in the tester?

Those of the account you’re going to trade: a robot that sizes its lots from the balance doesn’t trade the same way with 1,000 as with 100,000. The EU (and the UK) cap retail gold leverage at 1:20; elsewhere it depends on your broker’s regulator.

Risk warning

A backtest is a simulation on past data and doesn’t capture everything that happens in a live account: past or simulated results do not guarantee future results. Leveraged gold trading carries a high level of risk and you can lose some or all of your capital. The menus quoted are those of the English version of MT5 at the time of publication and may change. The AUREUM figures come from a simulation (backtest), not from a live account. This content is educational and is not financial advice.

AUREUM: its backtest report, as is

Software that trades XAU/USD in your own MetaTrader 5 account. Its homepage shows the 2020–2026 Strategy Tester report, drawdowns included: a maximum drawdown on balance of 21.84% across 439 trades. It’s a simulation, not a live account.

See the backtest report →