A profitable backtest is the easiest thing in the world to produce and the most dangerous result to trust. The Strategy Tester gives you the tools; whether you use them honestly is up to you.
In MT5, press Ctrl+R or use View → Strategy Tester. The tester panel opens at the bottom of the terminal. There are several tabs and a lot of settings. The ones that matter:
| Setting | What it does | Recommendation |
|---|---|---|
| Expert | Selects the EA to test | Pick from the dropdown |
| Symbol | The instrument to test against | Match the symbol you will trade live |
| Period | Timeframe | Match your EA's primary timeframe |
| Date | Start and end of the test window | Use at least 2 years for swing strategies, 1 year for intraday |
| Modelling | How ticks are simulated | Every tick based on real ticks for serious tests |
| Forward | Holds out a portion of the date range for out-of-sample test | Use this whenever optimising |
| Optimization | Enables parameter search | Off for single backtest, Genetic algorithm for optimisation |
MT5 offers three modelling modes:
The gold standard. MT5 downloads actual tick data from the broker's history server and replays it tick by tick. Spreads, bid/ask sequences, and timing match real history. This is the only mode appropriate for any EA that cares about precise entries (scalpers, EAs that trade near spread cost).
Limitation: only available for symbols and date ranges where the broker has stored tick history. Older data or less-traded symbols may force you to lower-quality modes.
MT5 generates synthetic ticks within each bar based on OHLC and a model. Faster than real ticks but the tick sequences are not real. Acceptable for EAs that only act on bar close, but the precise behaviour of stops, trailing logic, and partial fills will not match live conditions.
Only the 1-minute open, high, low, and close are used. The tester does not simulate intra-bar ticks at all. Fast but only useful for EAs that genuinely never look inside a bar.
Even faster. Only the open of each bar of the chosen timeframe is considered. Acceptable for the very first sanity check on a higher-timeframe EA; not acceptable for any conclusion you would act on.
The Spread field in the tester defaults to "Current". This means the test uses today's typical spread for the symbol. If you backtest XAUUSD with a current spread of 25 points but historically the spread was often 80 points during news events, your backtest will overstate net profit.
Better practice: set spread manually to a conservative value at the higher end of typical historical spreads. For XAUUSD, 40 to 50 points is more honest than the current quiet-market value.
Best practice if you have access: use real tick spreads, which capture the actual bid/ask history. This is the default when modelling mode is "Every tick based on real ticks".
The tester lets you set commission per round-turn lot in deposit currency. Almost everyone leaves this at zero, which understates trading costs.
For an ECN account with $7 per round-turn lot on XAUUSD, set commission to 7 in the tester. The tester will deduct this from each trade. For a "commission-free" markup-based account, set it to zero (the cost is already embedded in spread).
Optimisation lets you sweep input parameters across ranges and find the combination that produces the best result. The Strategy Tester offers two modes:
The trap is simple. If you sweep 5 parameters across 10 values each, you have 100,000 combinations. The Tester will find a combination that looks excellent in backtest. Almost always, that combination is curve-fit to historical noise. The "best" result tells you nothing about future performance.
The honest way to use optimisation is walk-forward. The idea: divide your data into multiple periods. Optimise on period 1, test the optimal parameters on period 2 without further tuning. Move forward: optimise on periods 1-2, test on period 3. And so on.
If the parameters that look optimal on past data continue to work on the next unseen period, you have evidence of a real edge. If each optimisation finds different "optimal" values and forward performance is mediocre, you are looking at noise.
MT5 has a built-in Forward optimisation option. When you enable Forward and set its percentage (e.g. 25%), the tester optimises on the first 75% of the date range and reports forward results on the last 25%. This is a one-shot walk-forward; for multi-step walk-forward you run multiple separate tests.
The Strategy Tester report contains many metrics. The ones that matter, in priority order:
| Metric | What it tells you | What to look for |
|---|---|---|
| Total net profit | Overall profit in deposit currency | Positive is necessary but not sufficient |
| Profit factor | Gross profit divided by gross loss | Above 1.3 for swing, above 1.5 for intraday is encouraging |
| Maximum equity drawdown | Largest peak-to-trough decline | Compare to expected real-account tolerance |
| Number of trades | Sample size | Need 100+ trades for any statistical confidence |
| Sharpe ratio | Risk-adjusted return | Above 1.0 is decent for a public-market EA; very high values often indicate overfit |
| Recovery factor | Net profit divided by max drawdown | Higher is better; 3+ is strong |
Patterns that suggest your result will not survive live trading:
An end-to-end process that minimises self-deception:
Even an out-of-sample positive result has uncertainty. Monte Carlo analysis simulates many alternative trade sequences (by reshuffling the order of historical trades) and reports the distribution of outcomes. MT5 does not include this natively, but several third-party tools accept Strategy Tester output and run Monte Carlo.
The output gives you a confidence interval: with 95% confidence, the maximum drawdown is between X and Y. This is more honest than the single drawdown number from one historical run.
Even a perfectly executed backtest hides several real-world frictions:
For strategies that hold trades for hours or days, at least 2 to 4 years. Longer is better but markets change; very old data may not reflect current microstructure. For scalping strategies, 6 to 12 months of high-quality tick data is often more useful than 5 years of mediocre data.
The Strategy Tester uses downloaded history regardless of whether you point at a demo or live account. Both demo and live broker servers can provide tick history depending on configuration; some demos have less history.
Possibly. If the strategy logic should apply to both, asymmetric performance is a warning that one of the tests is curve-fit. Robust strategies usually generalise across similar instruments (with parameter adjustments).
For tick-based modelling, the report shows "99% (real ticks)" when full tick data is available. Lower percentages indicate missing tick data filled with synthetic ticks. Aim for 99% real ticks for any EA you might trade live.
No. Backtests are necessary but not sufficient. Forward testing on a demo for at least one month is the minimum bar before risking real capital, and even then expect surprises.
We post live signals to compare against your backtests. Useful as an independent reference when evaluating whether your EA is performing rationally. Free for partner-broker clients.
See the signals →