MT5 Backtest Data Quality: Tick Modelling, History Gaps and Broker Data

Every backtest rests on an assumption that is easy to forget: that the price history it runs on is a fair picture of the market. If the data has gaps, bad prints, the wrong time zone or a crude model of price movement inside each bar, the backtest is measuring the data's quirks as much as the strategy.

MetaTrader 5 gives you more control over this than most traders use. This guide explains the Strategy Tester's modelling modes, what the history quality figure in the report means, how broker data differs, and how to audit your history with a few simple checks before you trust any result.

One point up front: better data makes a backtest more honest, not more optimistic. Moving to higher-quality data often makes results look worse, because it removes fills and price paths that were never really available. That is the information you want before risking money, not after.

The MT5 modelling modes, and when each one is valid

When you run a test, MT5 has to decide how price moved between the open, high, low and close of every bar. The modelling mode controls that decision.

ModeHow price is modelledValid for
Every tick based on real ticksUses the broker's recorded tick history, including spreadsStrategies sensitive to price movement within a bar, tight stops, trailing stops, scalping
Every tickGenerates synthetic ticks from one-minute barsA reasonable approximation when real ticks are not available
1 minute OHLCUses only the open, high, low and close of each one-minute barFaster checks for strategies with wider stops
Open prices onlyUses only the open price of each bar on the tested timeframeStrategies that act only at bar open and do not depend on intrabar stops
Math calculationsNo price data; for mathematical optimization tasksNot used for trading strategies

Every tick based on real ticks

This is the most realistic mode, because it replays prices that actually occurred on the broker's feed, with the spreads that came with them. It is also the slowest and needs the most data. Real tick history is downloaded from the broker's server, and how far back it goes varies from broker to broker and symbol to symbol.

Every tick (generated)

When real ticks are not available, MT5 can generate ticks from one-minute bars. The generated path always visits the minute's open, high, low and close, but the order and the steps in between are synthetic. For most strategies with stops wider than a few pips this is a usable approximation. For strategies that depend on the exact sequence of prices within a minute, it is not.

1 minute OHLC and Open prices only

These modes are much faster and are useful for early screening and large optimizations. The risk is using them for final results on a strategy they cannot model. "Open prices only" is only valid when the EA makes all its decisions at the open of a new bar and does not rely on intrabar stop-losses, take-profits or trailing logic being hit in the right order. A common approach is to screen in a fast mode, then confirm any shortlisted result in real-tick mode before drawing conclusions.

A quick validity check

Run the same EA over the same period in a fast mode and in real-tick mode. If the trade lists are essentially the same, the fast mode is valid for that strategy and you can use it to save time. If the results diverge materially, the strategy depends on intrabar behaviour, and only the real-tick results should be used.

What "history quality" in the report tells you

The tester report includes a history quality figure. It reflects how much of the test was covered by good history for the chosen mode. When you test with real ticks and some periods lack tick data, MT5 can fill those periods with generated ticks instead, and the quality figure drops.

Treat a low figure as a prompt to investigate, not as a number to explain away. Find out which periods are affected, check whether the strategy traded in them, and decide whether to shorten the test or source better data. Also note that a high quality figure tells you the data was present, not that it was clean. Gaps inside the broker's own history and bad prints can still be there.

Broker data is not "the market"

There is no single true price history for a spot FX or CFD market. Every broker's feed reflects its own liquidity providers, its own markup and its own server time. That has practical consequences.

  • Server time zones. Many brokers run server time a few hours ahead of UTC, often shifting with daylight saving. Where the server day begins decides where daily and four-hour bars open and close. Two brokers can produce different daily highs, lows and closes for the same day.
  • Sunday bars. Depending on server time, some feeds produce a short Sunday bar and others do not. That changes daily indicators, because a short bar counts as a full bar in a moving average.
  • Spread history. Real-tick data includes the broker's historical spreads. A broker whose spreads widen sharply at rollover will produce different results from one whose spreads stay tighter.
  • Symbol specifications. Digits, contract size, minimum stop distance and trading hours differ, and all of them affect how the tester executes trades.

The practical rule is simple: test on data from the broker and account type you intend to trade, or test on two brokers and treat any large difference as a warning that the strategy depends on feed details.

How to audit your history before trusting a backtest

You don't need special software. Export the bars from MT5 (or read them with the MetaTrader5 Python package) and run a few checks. These examples assume a pandas DataFrame of one-minute bars indexed by time.

Check 1: Gaps during trading hours

Weekends and holidays are expected gaps. Missing minutes in the middle of an active session are not.

import pandas as pd

def find_gaps(bars, max_gap="5min"):
    """List gaps between consecutive bars longer than max_gap, excluding weekends."""
    t = bars.index.to_series()
    delta = t.diff()
    gaps = delta[delta > pd.Timedelta(max_gap)]
    # ignore gaps that span a weekend (Friday or Saturday to Sunday or Monday)
    starts = t.shift(1)[gaps.index]
    weekday_gaps = gaps[~starts.dt.dayofweek.isin([4, 5])]
    return pd.DataFrame({"gap_start": starts[weekday_gaps.index], "length": weekday_gaps})

Sort the result by length and look at the largest gaps first. A few short gaps around holidays are normal. Long gaps on ordinary weekdays mean missing data, and any strategy that would have traded through them was tested on a fiction.

Check 2: Spikes and bad prints

A single bad tick can create a bar whose high or low is far outside the surrounding prices. If the strategy has a stop or a pending order near that level, the backtest records a fill that never happened. That false fill also distorts the drawdown record, which matters if you are testing an EA against prop-firm drawdown rules.

def find_spikes(bars, window=60, threshold=8.0):
    """Flag bars whose range is many times larger than the recent typical range."""
    rng = bars["high"] - bars["low"]
    typical = rng.rolling(window).median()
    ratio = rng / typical
    return bars[ratio > threshold].assign(range_ratio=ratio[ratio > threshold])

Not every flagged bar is an error. Major news releases produce genuinely large bars. Check each flagged bar against the time of known events, and against a second data source where possible.

Check 3: Coverage of different conditions

Count trades per year and check that the test period includes trending and ranging phases, and both high and low volatility. A test that covers only one kind of market can look excellent and tell you little. This matters doubly for walk-forward testing, where each out-of-sample window needs enough trades to be meaningful. The same applies to a single out-of-sample holdout: a holdout that misses whole market conditions tests very little.

Check 4: Compare two sources

Export the same symbol and period from a second broker, align time zones, and compare daily closes, highs and lows. Small differences are normal. Large or systematic ones, such as daily bars that consistently open at different hours, explain many puzzling differences between backtests.

Check 5: Real ticks versus generated ticks

For the period the strategy actually trades most, run the real-tick and generated-tick modes side by side. If they agree, you can be more confident in older periods where only generated ticks are available. If they don't, results from generated-tick periods should carry less weight.

When to use custom symbols

MT5 lets you create custom symbols and import your own bar or tick data into them. This is useful when you want a longer history than your broker provides, or a cleaner and more consistent dataset for research.

Two cautions apply. First, imported data still needs the same audit: gaps, spikes and time zone. Second, you also need to set the custom symbol's specification yourself, including digits, contract size, commission, swap and spread. A custom symbol with default settings can be a far kinder trading environment than any real account.

Common data mistakes

  1. Using a fast mode for final results. Fine for screening, unreliable for strategies with tight or intrabar exits.
  2. Ignoring a low history quality figure. It usually means part of the test ran on generated rather than real prices.
  3. Mixing brokers between testing and trading. Different server times and feeds make it a different test.
  4. Assuming high quality means clean data. Present data can still contain spikes and gaps.
  5. Testing only the recent past. Real-tick history is often shorter, which tempts traders to test over too short a period.
  6. Leaving custom symbols on default settings. Default costs and specifications rarely match a real account.

A short data-quality checklist

  • Modelling mode chosen deliberately, with real ticks used for final results where the strategy is sensitive to intrabar movement
  • Fast-mode results confirmed against a real-tick run before relying on them
  • History quality figure checked, and low-quality periods identified
  • Data from the same broker and account type you plan to trade, in its server time
  • Weekday gaps listed and reviewed
  • Spikes flagged and checked against known events or a second source
  • Test period covers trending, ranging, high-volatility and low-volatility phases
  • Custom symbols, if used, configured with realistic costs and specifications

Frequently asked questions

Which MT5 modelling mode should I use?

Use "Every tick based on real ticks" for final results whenever the strategy uses intrabar stops, targets or trailing logic, and when good tick history is available. Faster modes are fine for screening, and for strategies that only act at bar open, once you have confirmed they agree with a real-tick run.

What is a good history quality figure in MT5?

Higher is better, but there is no single threshold. More useful than the number itself is knowing which periods lacked good data and whether the strategy traded in them.

Why do two brokers give different backtest results for the same EA?

Their price feeds, spreads, server time zones and symbol specifications differ. Daily-bar strategies are especially affected by server time, because it changes where each day's bar begins and ends.

Can I use my own tick data in MT5?

Yes, through custom symbols. Imported data still needs checking for gaps, spikes and time zone, and the custom symbol needs realistic cost and contract settings.

Does high-quality data make a backtest reliable?

It removes one source of error. It does not protect against overfitting, unrealistic costs or changing market conditions, and a strategy tested on excellent data can still lose money.

Want a second pair of eyes?

Start with our free Sample Stress-Test Report. It walks one anonymized, illustrative strategy through a full stress test, start to finish, so you can see what rigorous validation looks like before you test your own.

Read the Sample Stress-Test Report

Want your own backtest checked? The Strategy Audit + 60-minute call is a paid service at a launch price of £100, credited in full against our build and portfolio offers. You send an MT4/MT5 Strategy Tester report or trade-list CSV; what we can check depends on the files you supply, and walk-forward and parameter sweeps are not included because they need the strategy itself. It is analysis of strategy testing, not investment advice, and does not promise any trading or evaluation outcome. See the Strategy Audit

Disclaimers

CollosoTrading provides educational content and analytical services for retail and professional algorithmic traders. We do not provide regulated investment advice, financial advice, or personal recommendations. Trading derivatives, leveraged products, and CFDs carries a high level of risk and may result in losses exceeding deposits. Past performance, including any verified or unverified historical results referenced on this site, is not indicative of future results. Consult an independent regulated financial adviser before making investment decisions.

All figures are backtests or simulations unless marked LIVE. Hypothetical or backtested performance results have inherent limitations and may not reflect actual trading. No representation is made that any account will or is likely to achieve profits or losses similar to those shown. Individual results vary. This article contains no performance figures from any strategy or account. We do not guarantee the outcome of any prop firm challenge.