How to Backtest in MT5: Using the Strategy Tester Without Fooling Yourself

· 6 min read · LunqFX Team

MT5 Strategy Tester settings panel with the every tick based on real ticks model selected

Anyone can produce a beautiful backtest. That is the problem. Learning how to backtest in MT5 properly is less about clicking Start and more about systematically removing the ways a test can flatter a strategy that would have lost money in real time. MT5's Strategy Tester is genuinely excellent — multi-threaded, real-tick capable, with forward-testing built in — and it will happily lie to you if you let it.

This guide covers the mechanics, the four traps that produce fake results, and a validation sequence that gives a number you can actually risk money on.

Opening the Tester and What Each Setting Means

Press Ctrl+R (or View → Strategy Tester). The settings that matter:

Expert / Indicator. MT5 can test Expert Advisors and, separately, indicators in visual mode. Testing an indicator visually is the fastest way to verify it doesn't repaint — see our repainting test.

Symbol and timeframe. Test on the exact symbol you trade, at your own broker. Not "EURUSD" generically — your broker's EURUSD, with its spreads and its history.

Date range. Include at least one violent period (a flash move, a major central-bank surprise) and at least one long dull range. A strategy tested only on a trending year is a trend strategy that hasn't met its enemy yet.

Forward period. MT5 can automatically reserve the last portion of your range for out-of-sample testing. Use it. This is the single most valuable checkbox in the panel and most traders never touch it.

Delays. Set a realistic execution delay (random or a fixed value in milliseconds) rather than zero. Zero-latency fills do not exist.

The Tick Models, Ranked by Honesty

MT5 Strategy Tester tick models ranked by accuracy from real ticks to open prices only

MT5 offers several modelling modes. In descending order of trustworthiness:

  1. Every tick based on real ticks — replays actual bid/ask ticks stored by your broker. The only acceptable model for scalping, anything below M15, and any final evaluation.
  2. Every tick — generates synthetic ticks inside each M1 bar. Adequate for slower strategies, misleading for fast ones.
  3. 1 minute OHLC — four prices per minute. Fine for a rough first pass on D1 systems, worthless for entries that depend on intrabar sequence.
  4. Open prices only — for bar-close systems only, and even then just as a speed sanity check.
  5. Math calculations — not a market test at all; used for optimising formulas.

Why "99% Modeling Quality" Proves Almost Nothing

Traders treat the modelling-quality percentage as a certificate. It isn't. The percentage measures data density, not correctness. It tells you how much granular history the tester had to work with — not whether that history has gaps, whether the spread used ever existed, or whether the ticks came from the broker you'll actually trade with.

A 99% test built on:

  • a fixed spread that never widened at news,
  • tick data downloaded from a different broker,
  • history with silent gaps over rollovers,

is a 99%-dense fiction. Practical rules that fix this:

  • Use variable/real spread, never a fixed value, especially for scalping systems where spread is a large share of the target (the cost math in our gold scalping guide shows how quickly this flips profitability).
  • Download history from the broker you trade, and check the Journal tab after the run — it reports data errors and gaps you would otherwise never see.
  • Model a commission if your account charges one. Zero-commission tests on raw-spread accounts overstate results by a large margin.

Optimisation: The Fastest Way to Build Something Useless

MT5's optimiser will happily test thousands of parameter combinations and hand you the best one. That number is almost always a lie, because with enough parameters you can fit any past perfectly — and the fit dies on contact with new data.

Guardrails that keep optimisation honest:

Optimise few parameters. Two or three. A strategy needing seven tuned inputs to work does not have an edge; it has a curve fit.

Look at the surface, not the peak. In the optimisation results, prefer a broad plateau of decent results over a single towering spike. If Length=19 makes 40% and Length=18 and 20 both lose money, you found noise, not a setting.

Always run the forward period. In-sample optimised results are a hypothesis. Out-of-sample performance is the test. If forward results collapse, discard the strategy — do not re-optimise on the forward data, which quietly converts it into more in-sample data.

Walk forward. Optimise on 2022–2023, test on 2024. Roll forward, repeat. Consistency across windows is the closest thing to proof this process offers.

Reading the Report: Which Numbers Matter

Ignore net profit first. Look at these, in order:

  • Maximum equity drawdown (%) — the real question is not what it made but what you'd have had to sit through. Double it in your imagination; live drawdowns exceed backtested ones.
  • Number of trades — under 100, treat every other statistic as noise. Under 30, the report is decoration.
  • Profit factor — gross profit ÷ gross loss. Anything above ~4 on a backtest usually signals curve fitting rather than genius.
  • Expected payoff and average R — the per-trade edge, which is the number that survives changes in position size. Our journal metrics guide covers reading this properly.
  • The equity curve shape — a smooth line with no losing months is the classic signature of martingale/grid sizing hiding losses, not of a stable edge.

The Validation Sequence

Run these in order; failing any step ends the process:

  1. Quick pass on 1-minute OHLC to confirm the strategy runs without errors.
  2. Full test on real ticks, variable spread, realistic commission and delay, across 5+ years including a crisis period.
  3. Forward period on data the optimiser never touched.
  4. Broker cross-check — repeat on a second broker's history. Results that only exist at one broker are data artefacts.
  5. Demo forward test, 4 weeks minimum, comparing live fills against backtest statistics trade by trade. This is where slippage reveals itself.
  6. Small live, because demo fills are more forgiving than real ones.

Only a strategy that survives all six deserves normal position sizing. Most don't survive step 3 — which is the entire point of doing this. A tester that kills bad strategies cheaply is worth more than one that validates good ones.

FAQ

How do I open the Strategy Tester in MT5? Press Ctrl+R or use View → Strategy Tester. Select your EA or indicator, symbol, timeframe, date range and tick model, then click Start.

What does 99% modeling quality mean in MT5? It means the tester had dense historical data to work with. It says nothing about whether that data was accurate, gap-free, or from your broker, so it is not proof a backtest is trustworthy.

Which tick model should I use for backtesting? "Every tick based on real ticks" for any final evaluation, and mandatory for scalping or sub-M15 strategies. Lower-fidelity models are for quick sanity checks only.

Can I backtest an indicator in MT5, not just an EA? Yes — run the tester in visual mode with the indicator attached. It is the most reliable way to confirm signals appear in real time rather than being drawn into history.

How many trades does a backtest need to be meaningful? At least 100. Below 30, the statistics are noise; between 30 and 100, treat them as a weak signal that justifies further testing, not a conclusion.

Why are my live results worse than my backtest? Most often spread and slippage that the test didn't model, an optimised curve fit that never generalised, or a repainting indicator underneath the logic.

All articles