Updated . Platform documentation and source links reviewed.
To backtest a Forex Expert Advisor (EA), save its version and settings, choose documented historical data, account for trading costs and run an unchanged baseline. Reserve separate data before optimising parameters, then inspect losses as well as profits. Keep the report, inputs and assumptions together so you can repeat the exercise. A backtest describes a historical simulation; it does not establish what the EA will earn on a live account.
Quick answer: A useful result is traceable to a particular EA, dataset and configuration. Check how prices and costs were modelled before comparing returns. Keep parameter tuning separate from validation, and investigate unexplained trades before moving to demo observation.
This workflow covers MetaTrader 4 (MT4) and MetaTrader 5 (MT5), with their differences identified below. It assumes you have the correct EA file and documentation. If those are missing, first evaluate the evidence before choosing an EA.
1. Save the version and establish a baseline
A baseline is the unchanged reference for later comparisons. Start by checking whether documented settings produce the expected trade sequence. Name the run and prepare this record:
- Record the EA filename, vendor version, platform build and date of the test.
- Select the broker’s exact symbol, including any suffix, and the documented chart timeframe.
- Record the account model, deposit currency, starting balance and leverage assumptions.
- Load the intended input values and save a separate preset before changing anything.
- Set the historical period and modelling mode, with optimisation disabled for the baseline.
MT4’s Expert Properties separates input Value from the Start, Step and Stop optimisation ranges. Use Save to preserve inputs. Record the actual values, not just the search ranges.
2. Check history coverage and choose a price model
A tick is a price update; a bar summarises an interval. Choose a model that represents the EA’s decisions between bar openings. Record why it fits the documented strategy.
The MT5 tick-generation documentation distinguishes real and generated ticks. If a minute bar exists without tick data, the tester can generate ticks. Real-tick mode does not prove that the entire test used recorded updates.
Open Prices Only calls the EA’s tick function at bar openings. Do not use it as sole evidence for decisions within a bar. Check the developer’s requirements and compare an appropriate detailed run.
Inspect the dates, missing-data messages and actual test period. Save the broker/server identity and data method. Record coverage limitations instead of shortening the period until the report looks favourable.
3. Match costs and execution to the platform
Spread is the difference between buying and selling quotes; commission and overnight financing are separate costs. Match assumptions to your intended account and sessions. Mark unknown charges unresolved.
MT4 stores Bid history and models Ask using the spread at test start or a custom Spread value. MT5’s real-tick spread can instead vary within a minute, as documented in its tick-generation reference.
| Assumption | MT4 check | MT5 check | Save |
|---|---|---|---|
| Spread | Record the fixed modelled value used | Real ticks can vary within a minute; generated ticks use the minute bar’s spread | Mode, source and any override |
| Commission | Check test charges against the broker schedule; identify omissions | Inspect commission configuration in advanced testing settings | Charge units and application |
| Overnight financing | Check the charge applied to held positions | Check symbol settings and resulting charges | Assumptions and sample entries |
| Execution | Document what your test environment actually models | Record the selected delay setting | Model limitations |
The MT5 testing guide documents configurable commissions and execution-delay emulation. Delay modelling is not a blanket simulation of every execution problem. For pending orders, the documented delay applies to placement rather than their later execution.
Do not use MT5’s profit calculation in pips as the final cost check: that mode omits swap, commission and margin control. Where a cost cannot be represented by your setup, state the omission. Do not quietly compensate with a guessed spread and describe the result as equivalent.
4. Run the unchanged test and inspect the trades
Run the baseline and inspect the journal for errors, absent trades and unexpected additions. Compare a documented entry, exit and losing sequence with the record. Resolve discrepancies before searching for better parameters.
The MT5 report reference defines profit factor as gross profit divided by gross loss and reports balance and equity drawdown separately. Drawdown measures a decline; equity reflects open-position effects. Inspect both, especially when losses remain open while profitable trades close.
Record net results, trade count, largest losses and losing sequences. Check whether one trade or short period dominates the outcome. Investigate abrupt graph changes without assuming their cause.
Do not use a universal profit-factor pass mark. Inspect the underlying data, costs and trades. For prop evaluations, also check the account rules; a tester summary does not establish compliance.
5. Reserve validation data before optimising
Optimisation tries different input combinations on historical data. First mark the tuning period and later validation period. Write the selection criteria, ranges and reason for each change. This method does not guarantee future results.
The MT5 optimisation guide explains input selection and range boundaries. Log discarded combinations too, so a chosen result does not conceal how many alternatives were tried.
Inspect nearby parameter values on the tuning data. Investigate trades behind sharp changes in results. A tighter stop is a new hypothesis, not an assured way to reduce overall losses.
Changing the intended session or holding period creates a new experiment. First match the EA to your trading style rather than redesigning tests around unsuitable demands.
6. Validate selected settings without retuning them
MT5’s Forward option reserves a later historical segment. During optimisation, selected runs from the first segment are checked on it, as the optimisation guide explains. Both segments use history; neither is demo trading as new prices arrive.
Repeated walk-forward analysis uses successive tuning and validation windows. One MT5 Forward split is not that repeated procedure. Record your method, date boundaries and selection rules.
Keep settings fixed during validation. Repeatedly choosing configurations from validation results makes that period part of the selection process. Record failed checks and reconsider the hypothesis; a later assessment needs unused evidence.
Compare costs, exposure, drawdown and trade behaviour across both periods. Keep weaker results visible. Meeting your criteria supports another research step, not a live-return promise.
7. Save the report and plan demo observations
In MT4’s Report tab, use the context-menu command Save as Report to create an HTML file, as documented in the official report instructions. Keep it beside the saved inputs. For MT5 optimisation results, the optimisation guide documents Export to XML; retain the selected single-run statistics and trade details too.
Keep the EA identity, preset, build, broker, symbol, dates, data method, costs, reports and journal evidence together. Add a decision note with unresolved questions. Open the saved files and confirm they describe the same run.
Observe the unchanged EA on demo for session timing, order rejections, reconnect behaviour and cost differences. Record expected versus actual actions. Plan around strategy activity and relevant scenarios; a fixed number of weeks cannot prove reliability.
Retest material changes to code, settings or broker conditions. Preserve earlier results to trace changes in behaviour.
Source check: MetaQuotes documentation was checked on 9 September 2026. The workflow and suggested observations are editorial guidance. No AutoPipShop product test, performance result or trading endorsement is claimed.
Frequently asked questions
What is the difference between backtesting and optimisation?
Backtesting examines one configuration on historical data; optimisation compares configurations. Save an unchanged baseline first, then record the ranges searched and the evidence used to choose settings.
Does real-tick mode guarantee complete real-tick coverage?
No. MT5 can generate ticks for a minute with a bar but no tick data. Check coverage and the test record, and describe any known substitution or gap instead of treating the mode’s name as a quality certificate.
Why can MT4 and MT5 backtests differ?
Compare code, broker history, symbols, inputs, price modelling and costs before judging the EA. In particular, do not equate MT4’s fixed modelled spread with MT5’s real-tick spread history.
Does a high win rate prove the EA is profitable?
No. Inspect monetary gains and losses, open exposure and included costs. Many small wins can be outweighed by larger losses. Keep win rate as one descriptive measure, not the decision rule.
Is MT5 Forward the same as demo forward testing?
No. The built-in Forward split checks a later historical segment. Demo observation follows new incoming prices. Label reports clearly and retain both the historical assumptions and the subsequent operational observations.
