How to backtest an EA in MT5 Strategy Tester (and read the report)
Open the Strategy Tester with Ctrl+R and pick the EA, symbol, timeframe and dates. Set the tick mode to “Every tick based on real ticks”, add a realistic delay and click Start. Then judge the result on equity drawdown, profit factor, recovery factor and trade count, not net profit.
A backtest won’t tell you what an EA will earn, but it is the fastest way to learn how it behaves: how often it trades, how long it holds positions and how deep its losing runs go. This guide shows how to backtest an EA in MT5 with settings that keep the test honest, what each line of the report means, and how to avoid tuning an EA to the past.
Run a backtest in MT5, step by step
- Open the Strategy Tester. Press Ctrl+R, or right-click the EA in the Navigator and choose Test.
- Choose the EA, symbol and timeframe on the Settings tab, matching how you will run it live.
- Set the dates. Use a custom period of at least two or three years that includes calm and fast markets. Set Forward to 1/3 so the latest third of the period is kept aside as an out-of-sample check.
- Pick the tick mode. Choose Every tick based on real ticks for the final test. The table below explains the alternatives.
- Add an execution delay. Use a random delay, or a fixed delay close to your real ping to the broker, so fills aren’t perfect.
- Match your account. Set the deposit, account currency and leverage to the ones you will trade with.
- Load the inputs. On the Inputs tab, load the set file you plan to use live. Our guide to set files explains how.
- Click Start. Tick Visualization if you want to watch the trades on a chart; it’s slower and isn’t available during optimisation.
MT5 tick generation modes compared
| Mode | What it uses | Use it for |
|---|---|---|
| Every tick based on real ticks | The broker’s recorded tick history, including real spreads | Final tests, scalpers and gold EAs |
| Every tick | Ticks generated from one-minute bars | When real tick history isn’t available |
| 1 minute OHLC | Four prices per minute: open, high, low, close | Quick checks of EAs that act on closed bars |
| Open prices only | Only the opening price of each bar | Fast optimisation of EAs that trade only at bar open |
| Math calculations | No price data | Mathematical optimisation, not trading tests |
Coarser modes run faster but flatter EAs that use tight stops or targets, because they can’t see what price did inside each bar. If a result holds only in a fast mode, don’t trust it.
How to read the MT5 backtest report
| Metric | What it means | What to look for |
|---|---|---|
| History quality | Share of correct one-minute data used in the test | As close to 100% as possible |
| Profit factor | Gross profit divided by gross loss | Roughly 1.3–2 is realistic; above 3 on few trades suggests curve fitting |
| Expected payoff | Average result of one deal | Clearly larger than your costs per trade |
| Recovery factor | Profit divided by maximum drawdown | Higher is better; compare EAs over the same period |
| Sharpe ratio | Return divided by its volatility (risk-free rate taken as zero) | Higher means smoother returns |
| Equity drawdown maximal / relative | Largest fall in equity, including open trades, in money and percent | The key risk number; can you live with it? |
| Balance drawdown | The same, counting only closed trades | Far below equity drawdown is a sign of held losers |
| Total trades | Number of trades in the test | Several hundred for meaningful statistics |
Look at the equity curve as well as the numbers. Long flat stretches, a curve that only works in one year, or equity dipping far below the balance line all tell you more than net profit.
Optimise without curve fitting
- Optimise few inputs. Every extra parameter makes it easier to fit noise.
- Use the forward period. Settings that only work in the optimised part and fail in the forward third are tuned to the past.
- Prefer stable regions. Choose settings whose neighbours also do well, not a single sharp peak.
- Stress the result. Re-run with a larger delay, a longer period and other symbols. A robust EA degrades gently.
- Use the speed. MT5 spreads optimisation across all CPU cores, other computers and the MQL5 Cloud Network, so test widely instead of picking one lucky run.
Grid and martingale EAs need extra care: their backtests often look smooth until one long move, so check the equity drawdown and the largest number of trades open at once. Our martingale vs grid comparison shows what to look for.
Why live results differ from the backtest
Even a careful backtest is optimistic. Live trading adds slippage, requotes, spread spikes and VPS delay, and your broker’s feed may differ from the history you tested on. Treat the backtest as a description of the EA’s behaviour, then confirm it on a demo or small live account. When you compare an EA’s live record with its tests, our guide to checking results on Myfxbook and FX Blue shows what to look at.
Live results will still differ from the test. Our guide to backtest vs live results explains why, and how to compare the two trade by trade.
MT5 backtesting FAQ
Which MT5 modelling mode is most accurate?
Every tick based on real ticks, because it replays the broker’s recorded ticks and spreads. Use the faster modes only for rough checks or for EAs that act at bar open.
How many years should I backtest an EA?
At least two or three years that include different market conditions, with the latest part kept as a forward test. Very short tests can be explained by luck.
What is a good profit factor in a backtest?
Around 1.3 to 2 over several hundred trades is realistic. Much higher values over few trades usually mean the settings were tuned to the test period.
Why is my backtest different from my live results?
Spread, slippage, delay and data differences. Test with real ticks and a delay, and expect live results to be somewhat worse.
Can I backtest an MT4 EA in MT5?
No. MT5 only runs .ex5 files. You need the MT5 version of the EA; see MT4 vs MT5 for expert advisors.
Risk warning. Backtests are simulations. They do not include every real-world cost and do not guarantee future results. Trading forex and CFDs on margin carries a high risk of losing money.
Sources, checked 6 November 2026: MT5 strategy testing · MT5 testing report · MT5 visual testing · MT5 hotkeys