How to Test an MT5 Expert Advisor in Strategy Tester (2026)

Step-by-step 2026 guide to backtesting an MT5 Expert Advisor in Strategy Tester: tick model, spread, slippage, walk-forward and Monte Carlo.

· Testing

How to properly test an EA from the Marketplace in MetaTrader 5 Strategy Tester

Buying an Expert Advisor from a marketplace has one huge advantage over almost any other "black box" trading product: you can run the EA yourself, on your own data, before you pay a cent. Every EA in the MQL5 Market — and in our own Marketplace — ships with a free demo version that runs in the MetaTrader 5 Strategy Tester. If a vendor refuses to give you one, that alone is a red flag.

This guide walks through the testing protocol we use internally at EA Quantum Lab when we evaluate an EA — ours or someone else's — before it touches a real account.

1. What the Strategy Tester actually does

The MT5 Strategy Tester is a deterministic replay engine. You give it:

  • a symbol and timeframe,
  • a date range,
  • a tick model,
  • a starting deposit and leverage,
  • a set of EA inputs,

and it walks every historical tick (or bar) through the EA's OnTick handler exactly as if it were live. The output is a full equity curve, trade-by-trade journal, and a stack of statistics: profit factor, Sharpe, recovery factor, expected payoff, max drawdown.

It is the most honest single tool you have. It is also extremely easy to fool yourself with it.

2. Tick model — the one setting that matters most

In MT5 there are three modes. Use them in this order:

  1. Every tick based on real ticks — replays the broker's real recorded ticks. This is the only mode that gives you a realistic picture for scalpers, news EAs, grids, or anything sensitive to spread and execution.
  2. Every tick — generates ticks from M1 bars. Acceptable for swing systems on H1 / H4 / D1, useless for anything sub-minute.
  3. OHLC M1 / Open prices only — fast optimization mode. Use it only for the first coarse pass over a parameter grid, never to judge whether a strategy is profitable.

If a vendor''s "amazing" backtest was produced on Open prices only, treat the result as marketing, not evidence.

3. Spread, commission, slippage

The tester lets you pick:

  • Current — current live spread of the symbol.
  • Custom — a fixed value in points.

For a fair test, set Custom spread to a realistic worst-case value for your broker, not the 0.1-pip teaser EURUSD spread some sites quote. For a typical RoboForex Pro account in 2026 that means roughly:

Symbol Realistic average Realistic worst-case
EURUSD 0.3 – 0.6 pts 15 – 25 pts (news)
GBPUSD 0.6 – 1.0 pts 25 – 40 pts
XAUUSD 12 – 18 pts 50 – 120 pts
BTCUSD $4 – $8 $40+

Don''t forget commission: add it explicitly in the tester settings (e.g. $3.5 per lot per side for ECN), otherwise scalping results will look magical and execute terribly.

4. The date range — long enough, varied enough

A backtest covering only 2023–2025 looks great on almost any trend system because USD/JPY trended for two years and indices ran straight up. To stress-test a strategy you need at least one full cycle of:

  • a strong directional move,
  • a violent reversal (Feb 2020, Oct 2022, Aug 2024),
  • a long sideways grind,
  • a rate-hike or election shock.

Minimum recommended window in 2026: 2015 → today on majors, 2018 → today on indices and metals, 2020 → today on crypto. Anything shorter is a sample, not a test.

5. Walk-forward, not curve-fit

Genetic optimization in MT5 will happily find a set of inputs that turns any equity curve into a hockey stick on the in-sample period. That is curve-fitting, and it is the number one reason "verified" robots blow up on live accounts.

The discipline:

  1. Split the date range into in-sample (IS) and out-of-sample (OOS), typically 70 / 30.
  2. Optimize only on IS.
  3. Take the top 5–10 parameter sets by recovery factor (not net profit).
  4. Run each, unchanged, on OOS.
  5. Keep only the sets where OOS performance is within ~30% of IS performance.

If every "good" IS set falls apart on OOS, the strategy doesn''t generalize. Move on.

6. Monte Carlo and equity-curve stress tests

The Strategy Tester''s report shows you one equity curve — the one that actually happened. That''s a single sample. Pull the trade list into Python (or any Monte Carlo tool) and:

  • randomly shuffle the order of trades 10 000 times,
  • randomly drop 10% of trades to simulate missed signals,
  • randomly add 1–3 points of negative slippage to each fill.

What you want to see: max drawdown across 95% of simulations stays inside what your account can survive. If even 5% of paths blow the account, the live result will eventually land there.

7. Forward test on a cent / demo account

A clean backtest is necessary but not sufficient. Before any EA from the Marketplace goes on a real account, we run it for 2–4 weeks minimum on a cent or demo account at the same broker, with the same VPS, same symbol, same timeframe. Then we compare:

  • number of trades per week vs. backtest expectation,
  • average spread paid vs. tester spread,
  • slippage distribution,
  • equity curve shape.

If the forward diverges from the backtest by more than ~20%, the model of execution is wrong, not the market.

8. Red flags that should make you walk away

After hundreds of evaluations, these are the patterns that almost always predict failure:

  • "100% wins" or "no losing months" in the marketing.
  • Backtest only on Open prices only.
  • Date range shorter than 2 years.
  • No drawdown chart, or a y-axis cropped to hide it.
  • Equity curve goes straight up with no flat periods — almost always a martingale or grid hiding inside.
  • EA refuses to run in visual mode (vendor doesn''t want you to see what it does).
  • "Set files" required to reproduce the result, with the vendor''s set files being secret.

None of these are by themselves proof of fraud — but together they are a near-perfect filter.

9. Our internal checklist

Before any EA — ours included — is published to the Marketplace or attached to a CopyFX account, it has to pass:

  1. Real-tick backtest on 8+ years per symbol.
  2. Walk-forward with IS / OOS degradation < 30%.
  3. Monte Carlo with 95th-percentile drawdown below the account''s max drawdown limit.
  4. 4 weeks forward on a cent account next to the broker''s data center.
  5. Identical magic number, version, and .ex5 hash from backtest → forward → live.

Anything that fails one of these doesn''t get sold. That''s the floor, not the ceiling.

Want to see real examples?

Browse our live accounts in Live Monitoring, the strategies running on our public CopyFX accounts, or ready-to-use Expert Advisors in the Marketplace. Every one of them was put through the protocol above before it went live.

Failed to load the app

Something went wrong while loading. Try reloading the page — if the issue persists, clear your browser cache (Ctrl+Shift+R).