Skip to content
Free toolCheck your prop firm daily loss limit in 10 seconds →

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

  1. Open the Strategy Tester. Press Ctrl+R, or right-click the EA in the Navigator and choose Test.
  2. Choose the EA, symbol and timeframe on the Settings tab, matching how you will run it live.
  3. 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.
  4. Pick the tick mode. Choose Every tick based on real ticks for the final test. The table below explains the alternatives.
  5. 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.
  6. Match your account. Set the deposit, account currency and leverage to the ones you will trade with.
  7. Load the inputs. On the Inputs tab, load the set file you plan to use live. Our guide to set files explains how.
  8. 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

ModeWhat it usesUse it for
Every tick based on real ticksThe broker’s recorded tick history, including real spreadsFinal tests, scalpers and gold EAs
Every tickTicks generated from one-minute barsWhen real tick history isn’t available
1 minute OHLCFour prices per minute: open, high, low, closeQuick checks of EAs that act on closed bars
Open prices onlyOnly the opening price of each barFast optimisation of EAs that trade only at bar open
Math calculationsNo price dataMathematical 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

MetricWhat it meansWhat to look for
History qualityShare of correct one-minute data used in the testAs close to 100% as possible
Profit factorGross profit divided by gross lossRoughly 1.3–2 is realistic; above 3 on few trades suggests curve fitting
Expected payoffAverage result of one dealClearly larger than your costs per trade
Recovery factorProfit divided by maximum drawdownHigher is better; compare EAs over the same period
Sharpe ratioReturn divided by its volatility (risk-free rate taken as zero)Higher means smoother returns
Equity drawdown maximal / relativeLargest fall in equity, including open trades, in money and percentThe key risk number; can you live with it?
Balance drawdownThe same, counting only closed tradesFar below equity drawdown is a sign of held losers
Total tradesNumber of trades in the testSeveral 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