In this article
After this article, you can
- Identify the denominator of a data coverage measure.
- Separate record share from the count of time intervals.
Terms at hand: Backtesting · bid and ask (bid-ask prices) · spread (bid-ask spread) · Commission · Drawdown · Win Rate
A profitable backtest can differ sharply from live trading when the data, execution assumptions or parameter selection are unrealistic. This guide explains the MT4 and MT5 testing modes, cost modelling and out-of-sample checks that help diagnose those differences.
MT4 versus MT5 Strategy Tester — what really differs
Strategy Tester runs an Expert Advisor on history in both platforms. MT5 supports multi-symbol tests and distributes optimisation passes among agents; this does not mean one EA run automatically uses every core. MT4 also has a genetic optimiser, but its standard tester does not execute trades on symbols other than the tested one. Adding separate reports does not reproduce shared portfolio capital. Record the program build, compiled EA, inputs, symbol specification and account assumptions. History Center’s downloaded MT4 data can differ from the broker’s server history. Neither data duration nor a timeframe label determines suitability. Background in MT4 basics and the MT5 feature comparison.
Many ticks do not mean many minutes with ticks
Before comparing data-quality percentages, identify whether the count concerns time intervals or individual records.
Scroll sideways to see the full diagram
Assumptions: Fictional data for three equally long minutes, each with a minute bar. The counts 10, 10 and 80 form the complete controlled dataset; minute three contains only generated records. This does not assess an actual market feed or test.
Our dataset has three complete minute bars. Two minutes contain 10 real ticks each. The third has a minute bar but no real ticks; this fictional example generates 80 records there. The final dataset contains 100 records.
Our real-tick minute coverage is 2 /3 ≈ 66.67%. Our share of real records is 20 /100 = 20%. Numerous records in one minute change the second denominator without adding another minute of history. The percentages are not interchangeable and neither establishes a strategy edge.
MetaQuotes — real and generated ticks describes filling minutes with no available ticks when a minute bar exists. We invented the number 80 for the calculation; it is not a tester report value. Both measures are custom and do not define the Modelling Quality field.
Modelling modes and historical data quality
MT4 offers Open prices only, Control points and Every tick modelling. These modes use bar history and generated paths; Control points is a coarse preliminary estimate. MT5 additionally offers recorded broker ticks and 1 minute OHLC. Intrabar stops can matter even for a daily signal, while a rule compatible with bar-opening operation may permit simplification after checking the model’s limits. In MT5, a minute bar lacking real ticks can be filled with generated ticks. Real-tick spread can vary within a minute; generated ticks use the minute bar’s assigned spread.
Check historical data coverage for the specific instrument and period. Importing external ticks into MT4 requires a compatible process and may involve generated test files or additional software; HST bars alone do not guarantee genuine tick modelling. A reported quality percentage is not proof of realistic execution. In MT5, inspect real-tick coverage and any generated replacements.
Simulation parameters — spread, commission, swap, slippage
Check spread, commission, financing and execution-delay settings for the product and account. Standard MT4 adds its selected spread to Bid history; the default uses the current spread at the start of testing, rather than a complete historical spread path. With an assumed five-decimal EUR/USD quote, 12 points of 0.00001 equal 1.2 pips of 0.0001. MT5 supports account or custom commissions: inspect whether charges apply to entry, exit or both, and reconcile one closed trade. Its profit-in-pips mode omits commission, swap and margin control. Delay emulation is a scenario, not a reconstruction of all live liquidity or fills.
Three pitfalls that wreck a backtest
Look-ahead bias means using information unavailable at the decision time. A timeseries reference with shift zero denotes the current bar, which evolves during the simulation. At 10:15, the high already reached by the H1 bar starting at 10:00 is available; its final hourly high is not. A completed-hour rule must wait. Do not change every zero to one: valid new-bar detection and current-price rules would change too. Check the timestamp, copied count and array indexing direction for every input.
In a hypothetical successful CopyRates call, four closes from oldest to current are 100, 101, 102 and 103. In a dynamic array with as_series = false, rates[1].close is 101 and the last completed close is rates[2].close = 102. With as_series = true, rates[1].close is 102. The rule “last completed close >101.5” is true, yet a mistaken normal-array rates[1] read rejects it. This is an old-bar identification error, not evidence of future information. Do not index as if four records exist when the call returns fewer.
Overfitting can occur when repeated searches select favourable noise. High win rate, profit factor or low drawdown alone is not proof of it. Survivorship bias occurs when the test universe excludes instruments or accounts that were available historically but later disappeared. Build the universe using what was available at each date; there is no verified universal 30–50 percent inflation of results.
Reading the report and walk-forward as the antidote to curve-fit
Read net outcomes, trade counts, drawdown and cost assumptions together. In a hypothetical PLN account starting at 10,000, closed gains of 500 produce balance 10,500; an open loss of 700 leaves equity 9,800 before other charges or changes. Balance alone hides that exposure. Profit-factor or Sharpe thresholds do not certify a strategy. Inspect sensitivity and genuinely separate evaluation data, and preserve both reports and logs.
Walk-forward testing evaluates successive frozen parameter selections on later periods. Compare consistent annualised returns and inspect the chronological out-of-sample trade series. WFE alone cannot prove robustness or identify curve-fitting, and a zero or negative in-sample return complicates interpretation. See walk-forward analysis for the procedure.
Out-of-sample tests assess frozen rules on data excluded from the associated parameter search. They remain simulations with data and execution assumptions, rather than verified future live performance.
Limits of MT4/MT5 and when to reach for other tools
Strategy Tester evaluates coded rules under its data and execution model. A discretionary judgement needs recorded criteria and a replay protocol before it can be compared meaningfully; it is not automatically untestable. Choose another tool if a required input or execution mechanism cannot be represented, and check its current documentation and data terms. Our Forex Tester comparison addresses a different replay workflow. Platform-independent methodology lives in how to backtest a strategy correctly; wider context sits in the trader’s workshop in our library.
Does tester TimeGMT validate a UTC time filter?
In the MT5 tester, TimeGMT equals simulated TimeTradeServer. Comparing these functions in one test does not reconstruct the broker’s historical offset from UTC. Identify each time axis and test conversion on explicit inputs. A fixed “subtract two hours” does not document changes to server time.
Does tester TimeGMT validate a UTC time filter?
Our model allows times from 12:00 inclusive to 13:00 UTC exclusive. A decision at 12:00 UTC is inside the window. Under the declared UTC+2, that instant reads 14:00; treating the 14 as UTC would reject it. The +2 assumption belongs only to this sample. Test the exact end boundary, date changes and every offset transition in the actual documented schedule separately.
Exercise: do two equal tester clocks prove the filter behaves identically live?
No. They establish equality within the simulation. Assess conversion using explicit UTC, a documented offset for the date and interval-boundary tests. A function name does not establish the broker’s time zone.
Check the export before the next test run
Prepare five columns headed timestamp,open,high,low,close with explicit time-zone offsets. In the local CSV coverage checker, enter the first and last expected bar openings and the interval. The synthetic M1 example from 08:00 through 08:11 has twelve rows but only eight distinct valid timestamps: four empty positions, two repeated rows and one conflicting OHLC group. Save the report, then investigate gaps against the product’s sessions. Complete OHLC does not prove complete recorded tick history; the checker neither inserts prices nor validates the tester’s execution model.
What to do tomorrow
- Choose a documented dataset for the intended product and dates. In MT4, inspect bar history, modelling and any external FXT preparation. In MT5, inspect real-tick coverage and generated replacements. Archive the provider, time zone, missing periods and model settings; a mode’s name alone does not establish validity.
- Configure the costs and available execution-delay settings for your actual test environment. Use the account’s documented commission, financing and spread assumptions, then stress less favourable conditions. Avoid applying fixed $7 and pip penalties as universal broker parameters.
- Use four years for parameter selection and the following year for a frozen out-of-sample test, if that division suits the strategy. Compare annualised returns on a consistent basis, but do not diagnose curve-fitting solely because WFE is below 0.5. Review sample size, regimes and costs, and preserve an untouched final evaluation.
- Review when each price and indicator value becomes available. Change index zero to a completed-bar reference only if the strategy requires completed bars. Compare the resulting signal timestamps and trades; a 30 percent result change is not proof of look-ahead bias by itself.
Check your understanding
One short exercise
About 2 min · you can try again
The generator adds more records within the same third minute. What remains unchanged in our model?
- The real-record share remains 20%.
- Minute coverage by real ticks remains 2 /3.
- Minute coverage becomes 100% because every record has a price.
Check the answer and explanation
Minute coverage by real ticks remains 2 /3.
No additional minute containing real ticks was added. This custom measure counts minutes, not records.
Frequently asked
How does 99 percent modelling quality differ from 90 percent in MT4?
MT4’s modelling-quality field concerns how ticks were modelled from available history; it is not a percentage of correctly forecast prices or future profits. An external tool’s 99% display requires that tool’s own data and preparation checks. Inspect intrabar assumptions, quote sides and costs rather than accepting a percentage or timeframe cutoff. MT5’s real-tick mode also requires coverage checks because minute bars lacking ticks can be filled with generated data.
How do I configure the MT5 Strategy Tester step by step?
Open Strategy Tester, choose the compiled EA and save its inputs and terminal build. Select the intended symbol, timeframe, dates, initial deposit and currency, account model and margin settings. Choose a tick mode suitable for the rules and available history; verify commission, swap and any execution delay. Run a single test with optimisation disabled before searching parameters. Reconcile individual operations and archive the report and journal. Data length and download time have no universal five-year minimum or fixed duration.
What is look-ahead bias and how do I avoid it in MQL5?
Look-ahead bias uses information unavailable when the simulated decision was made. Shift zero can legitimately contain the current bar’s values so far; it does not automatically reveal that bar’s final high or close. A completed-bar rule must use a completed observation and verify its timestamp. CopyRates start_pos and destination-array indices are different concepts: check as_series, returned count and bar times. A difference between demo and backtest does not diagnose leakage by itself.
Manual versus automated backtesting — which one makes sense?
Manual replay can document discretionary criteria and ambiguous cases; repeated passes can still be biased by knowledge of later prices. A coded test can reproduce specified rules if its data, versions, settings and randomness are controlled. Generating thousands of trades does not create statistical independence or prove significance. Compare both methods on the same recorded signals and execution assumptions. There is no established 100-trade starting rule, fixed work-hour estimate or universal mechanical-system success rate.
Sources & bibliography
-
MetaQuotes MetaTrader 5 — Testing Trading Strategies · Official MT5 help on testing modes, simulation parameters and optimisation. www.metatrader5.com ↗
-
MetaQuotes MQL5 Reference — Testing Trading Strategies · MQL5 documentation explains tick-modeling modes and strategy-tester limitations. www.mql5.com ↗
-
MetaQuotes MetaTrader 4 — Strategy Testing · Official MT4 help on modelling quality and Strategy Tester reports. www.metatrader4.com ↗
-
Dukascopy Bank SA Historical Data Export · The provider offers historical market-data export. www.dukascopy.com ↗
-
MetaQuotes MT4 Strategy Tester: Setup · MT4 documentation explains bar-derived modelling modes, genetic optimisation, FXT history and the selected spread used to construct Ask prices. www.metatrader4.com ↗
-
MQL4 Reference Operation of Programs in the Strategy Tester · The standard MT4 tester limits trade operations to the tested symbol and does not execute listed external communication functions. docs.mql4.com ↗
-
MQL5 Reference CopyRates · The API distinguishes the current-bar shift from the physical order of copied records and documents returned counts, errors and incomplete data. www.mql5.com ↗
-
MetaQuotes Ltd MQL5 Reference — TimeGMT · In the tester, TimeGMT equals simulated TimeTradeServer. www.mql5.com ↗
