MT5 Strategy Tester: Six Ways a Backtest Misleads You

Bar chart of the best profit factor among 1, 10, 100 and 1,000 random strategies beside the same strategies on fresh trades, which stays near 1.0.

The MT5 Strategy Tester is a useful tool, and its output is easy to over-read. A result is a simulation: it depends on how the tester builds ticks, which spread it uses, which costs it includes, and how many settings were tried before you saw the report. None of these shows up as a warning on the equity curve.

This post walks through six places where a backtest can look better than the conditions it claims to model. Each has one worked example with invented numbers. For general method (rules, sample size, out-of-sample data) see our lesson on how to test a strategy.

On this page 11 min read
  1. Key findings
  2. 1. Tick mode: what happens inside a bar
  3. 2. Spread: fixed or variable
  4. 3. History quality (not "modelling quality")
  5. 4. Costs left out
  6. 5. Optimisation and overfitting
  7. 6. Reading the report
  8. A minimal protocol
  9. What to take from it
  10. Frequently asked questions
  11. Method and data
  12. Sources and further reading
  13. Keep reading

Key findings

  • The tester has four ways to build prices inside a bar. The faster ones use few prices per bar, so a stop and a target inside the same bar can be filled in an order the real market did not follow.
  • Spread matters in proportion to the stop. In our example, 1.5 pips of spread is 7.5% of a 20 pip stop and 30% of a 5 pip stop; the 5 pip system needs a 65% win rate to break even at 1:1.
  • In our example, commission and slippage take 83% of a 500 trade gross result.
  • Among 1,000 random coin-flip strategies, the best one averages a profit factor of 1.60 over 200 trades; on 200 fresh trades the same strategies average 1.01.
  • At 30 trades, a strategy with no edge reaches a profit factor of 1.5 or more 18.1% of the time.

1. Tick mode: what happens inside a bar

The MetaTrader 5 help lists four modes. “Every tick” simulates all ticks. “Every tick based on real ticks” uses “real ticks of financial instruments, accumulated by brokers” with no simulation. “1 minute OHLC” emulates only four prices (open, high, low, close) for each minute bar. “Open prices only” models OHLC prices but uses only the open price of each bar, and the tick_generation page warns that stop levels and pending orders may trigger at a price different from the specified one.

Why it matters: if a bar’s range touches both your stop and your target, the data alone cannot say which came first. A mode that builds only a few prices per bar has to assume an order.

Worked example. An H1 bar opens at 1.1000, reaches 1.1030 and falls to 1.0980. A long trade with a 20 pip stop (1.0980) and a 30 pip target (1.1030) touches both inside one bar. If the simulated path hits the stop first, the trade is -20 pips; if it hits the target first, +30 pips. The 50 pip gap between those outcomes is decided by the tester’s path assumption. Real ticks remove that assumption for the order inside the bar, though the tick_generation page notes that if tick data is missing for a bar, ticks are generated to fill it.

Check: run the same settings in two tick modes and compare trade counts and profit. Large differences mean the result depends on the modelling, not on the rules.

2. Spread: fixed or variable

The tick_generation page says that in real-tick testing spreads can change within a minute bar. The help pages we read do not describe the tester’s spread setting, so check in your terminal whether a run uses a fixed value or recorded spreads, and write it down.

The reason is proportion. Spread is a cost paid on every round trip, so its weight depends on the stop distance. Assume a 1:1 payoff and a cost in R of spread divided by stop. Break-even win rate is then (1 + cost) / 2.

Stop Spread Spread as share of stop Break-even win rate
20 pips 0.2 pip 1.0% 50.5%
20 pips 1.5 pips 7.5% 53.8%
5 pips 0.2 pip 4.0% 52.0%
5 pips 1.5 pips 30.0% 65.0%

Invented inputs, 1:1 payoff, spread paid once per round trip. Computed by script.

A wide-stop system barely notices the change from 0.2 to 1.5 pips; the 5 pip system moves from needing 52% to needing 65%. A backtest run at a quiet-hours spread can flatter the second system far more than the first. Our lesson on order types, spreads and costs covers spread in more detail.

3. History quality (not “modelling quality”)

Ticks in the tester come from history, and history can have gaps. The test_preparation page says the terminal downloads M1 bars and tick data from the trading server, and that if history is too short the tester shifts the start date forward. The tick_generation page says minute data is considered more reliable: if a minute bar has no tick data, the tester generates ticks for it, and tick data without a matching minute bar is ignored.

The testing_report page defines History Quality as the percentage of correct one-minute data compared with incorrect data. Bars with a tick volume of 1 and differing open, high, low and close count as incorrect, and so do history gaps. The test period is split into intervals and each is scored. The page colours intervals below 50% quality red, but gives no pass or fail threshold for a test as a whole, and we do not give one.

Worked example (a check, not a number). Check the start date. If you asked for ten years and the report starts later, the shifted date is the real test period. Then run the same test on the history of a second server for the same symbol, if you have one. If the trade list changes, the result is partly a property of the data feed.

4. Costs left out

A backtest only subtracts the costs it is told about. Commission, slippage and swap depend on the account and on live conditions, and the testing page describes commission settings and execution delay, but not slippage as such or how swap is applied in each mode, so test one trade and read the deal list.

Worked example. Invented numbers: 500 trades of 1 lot, 10 dollars per pip, an average gross result of 1.2 pips per trade, commission of 7 dollars per lot round turn (0.7 pip) and slippage of 0.3 pip per trade.

Item Dollars
Gross result (500 x 1.2 pips x 10) 6,000
Commission (500 x 7) -3,500
Slippage (500 x 0.3 pip x 10) -1,500
Net 1,000

Invented inputs; swap ignored. Computed by script.

The net is 0.2 pip per trade, 16.7% of the gross. The more trades a system takes, the more a fixed per-trade cost matters; see the profit and loss calculator to try your own numbers.

5. Optimisation and overfitting

The help describes two optimisation types: a complete algorithm that runs every combination of inputs, and a genetic algorithm described as much faster and almost of the same quality. The page names criteria such as “Balance max” and “Profit Factor max” and does not discuss whether the winner holds up on unseen data.

Our lesson on how to test a strategy runs a general version of this experiment; here it is applied to the tester’s optimiser and Forward setting. The risk is statistical. Bailey, Borwein, Lopez de Prado and Zhu argue that testing a large number of strategies on the same data makes false positives likely, because a 5% false-positive rate only holds when a test is applied once. We built the simplest version of that idea.

Worked example: best of N random strategies. Each strategy takes 200 independent trades that win or lose exactly 1R with equal probability. It has no edge by construction. We take the one with the most wins, measure its profit factor (gross profit divided by gross loss), then give that same strategy 200 fresh trades. Seeded simulation, 4,000 repetitions per row.

Strategies tried Chance the best has profit factor 1.3 or more Mean profit factor of the best Mean profit factor on 200 fresh trades
1 2.8% 1.01 1.01
10 24.7% 1.25 1.01
100 94.1% 1.43 1.01
1,000 >99.9% 1.60 1.01

Second column is exact (binomial; the 1,000 row is 99.99999999995%, shown as >99.9%); the other two come from the seeded simulation. Costs ignored.

With 1,000 strategies the best averages +45.7R over its 200 trades, and on fresh trades the same strategies average +0.03R. The report for the best one would look like a finding. The search found luck, which is the point of Bailey et al.’s warning. Real parameter sets are correlated, not independent, so the exact rows will differ, but the direction of the effect remains as long as the tries are not identical copies of one another.

The Strategy Tester’s own Forward setting splits the period and, per the testing page, always takes the second (latest) part for forward testing, shown on a separate tab. That is a useful check only if you do not keep re-optimising until the forward result looks good: every look is another trial. Write down how many combinations you tried.

6. Reading the report

Three numbers that mislead on a quick read.

Profit factor is gross profit divided by gross loss; the report page says a value of one means they are equal. It is noisy on few trades. With 1R wins and losses and no edge, the chance of reaching 1.5 or more is 18.1% over 30 trades (18 or more wins) and 0.3% over 200 trades (120 or more wins). A profit factor of 1.5 on 30 trades is weak evidence.

Drawdown comes in balance and equity versions. The page defines the equity version the same way as the balance version but using equity. Balance moves only when a trade closes. A trade can sit 1,200 dollars under water on a 10,000 balance and close in profit: the balance drawdown is 0% and the equity drawdown is 12.0%. Check the equity figure.

Trade count. The report’s headline profit says nothing about how many trades produced it. See our lesson on judging a track record for what a small sample can and cannot show.

A minimal protocol

This is a checklist, not a recommendation of any setting:

  1. Record the tick mode, spread setting, date range and any shifted start date.
  2. Re-run in a second tick mode and compare trade counts.
  3. Enter commission and slippage you could plausibly face, then compare net with gross.
  4. Count the combinations you tested.
  5. Keep a period the optimiser never saw, and look at it once.
  6. Read equity drawdown and the number of trades, not only profit.

Our ICT strategy backtester shows one way to report a result next to a random baseline. For choosing an automated product, see how to vet a forex expert advisor; for a different way a clean-looking backtest can hide risk, see the arithmetic of martingale and grid EAs.

What to take from it

  • A backtest is a model. Say which tick mode, spread and costs it used before you quote its result.
  • Cost weight scales with the stop and the trade count.
  • A best result among many tries is expected even when nothing real is there.
  • A good report is a hypothesis, not a forecast.

Frequently asked questions

Which tick mode should I use in the MT5 Strategy Tester?

The help describes the modes but does not say which to use. Every tick based on real ticks uses broker-recorded ticks without simulation; the faster modes build fewer prices per bar. Compare two modes on your own rules and treat large gaps as a warning about the model.

What is modelling quality in the MT5 Strategy Tester?

The help pages we opened do not use that term. They define History Quality as the share of correct one-minute data compared with incorrect data, with gaps counted as incorrect, and they give no pass or fail threshold, beyond showing intervals under 50% in red. Read your own report’s wording and the data gaps behind it.

Does a profitable backtest mean an EA will make money live?

No. A backtest is a simulation of past data with chosen settings, and it cannot show how a strategy will behave later. It can reveal rules that fail badly even in the model. Treat a good result as a hypothesis, and test it on data the optimiser never saw.

How many optimisation runs are too many?

There is no fixed number. The more combinations you try on the same data, the more likely the best one reflects luck, as our best-of-N example shows for random strategies: the best of 10 reached a profit factor of 1.3 or more 24.7% of the time and the best of 1,000 did so more than 99.9% of the time, while fresh trades averaged 1.01. Record how many you tried and judge the winner against that count, not against the single report.

Why does my live trading differ from my backtest?

Common causes are differences in spread, slippage, commission and swap, in how ticks were built inside bars, and in history data. A short sample or over-tuning can add a gap.

Method and data

This post uses no market data. We computed every number with our own script, and automated tests of ours check them; the method is described here. The bar, spreads, costs and drawdown example are invented. The best-of-N table uses a fixed seed, 200 trades per strategy, 4,000 repetitions and independent coin-flip trades with 1R wins and losses; the profit factor probabilities in the table’s second column, and the figures for 30 and 200 trades, are exact binomial results. Limits: no costs, independent strategies and trades, and a single trade size. MetaTrader 5 statements come from the help pages listed below, read on 22 November 2026; versions of the terminal can differ.

Educational content only, not financial advice. Trading involves substantial risk of loss. Read the full risk disclaimer.

Sources and further reading

  • MetaTrader 5 Help, Testing Trading Strategies: https://www.metatrader5.com/en/terminal/help/algotrading/testing
  • MetaTrader 5 Help, Tick generation: https://www.metatrader5.com/en/terminal/help/algotrading/tick_generation
  • MetaTrader 5 Help, Preparing for testing: https://www.metatrader5.com/en/terminal/help/algotrading/test_preparation
  • MetaTrader 5 Help, Optimization types: https://www.metatrader5.com/en/terminal/help/algotrading/optimization_types
  • MetaTrader 5 Help, Testing report: https://www.metatrader5.com/en/terminal/help/algotrading/testing_report
  • Bailey, Borwein, Lopez de Prado and Zhu, “The Probability of Backtest Overfitting” (Journal of Computational Finance, 2017; SSRN version revised February 2015): https://www.davidhbailey.com/dhbpapers/backtest-prob.pdf

Keep reading

Last reviewed 22 November 2026. Published by ChartriaAI. Questions or corrections: use our contact page, and see how we check our work.

Educational content only, not financial advice. Trading involves substantial risk of loss.