Illuminati Forex homeExplore the vault ↗
Guide · Testing

How to backtest an EA in the MT5 Strategy Tester

A backtest will not tell you an EA works. Done properly, it tells you quickly when one does not, and that saves real money.

The short answer

Open the Strategy Tester in MT5 with Ctrl+R (View → Strategy Tester). Choose the EA, symbol and timeframe, set a date range of at least one to two years, pick the modelling mode "Every tick based on real ticks", enter a realistic deposit and leverage, and press Start. Judge the result on maximum drawdown, profit factor and number of trades, not on net profit alone.

What is backtesting an EA?

Backtesting runs an Expert Advisor on historical price data to see how it would have traded. MT5's built-in Strategy Tester does this for any EA in your Experts folder, and it can also optimise settings and run a forward test on data the optimisation never saw.

How do you run a backtest in MT5, step by step?

  1. Open the Strategy Tester: press Ctrl+R or click View → Strategy Tester.
  2. Expert: choose the EA from the list. If it is missing, install it first (how to install an EA in MT5).
  3. Symbol and timeframe: use exactly what the EA's guide says, for example XAUUSD on M15.
  4. Date: pick a custom range of at least one to two years, so it covers quiet and volatile markets.
  5. Forward: leave it off for a first test. Later, set 1/3 or 1/4 to keep part of the data unseen.
  6. Delays: choose a realistic random delay rather than zero latency.
  7. Modelling: choose Every tick based on real ticks.
  8. Deposit and leverage: enter the amount you would really trade with, and your account's real leverage.
  9. Inputs tab: set the EA's settings exactly as you would live.
  10. Press Start and wait. MT5 downloads the tick history from your broker first, which can take a while.

Which modelling mode should you use?

ModeAccuracyUse it for
Every tick based on real ticksHighest: real broker ticks and real historical spreadsFinal tests, scalpers, gold EAs
Every tickHigh: ticks generated from M1 dataWhen real tick history is short
1 minute OHLCMedium: four prices per minuteFast first checks
Open prices onlyLow: one price per barOnly EAs that act on bar open
Math calculationsNo market dataNot for trading EAs

For gold, real ticks matter: XAUUSD spreads widen sharply around news and at the daily rollover, and a test with a fixed spread can make a weak EA look good.

Which backtest results matter most?

MetricWhat it tells youWhat to look for
Maximal drawdown (equity)The worst fall from a peak, including open tradesA level you could really sit through
Profit factorGross profit divided by gross lossComfortably above 1; suspiciously high values deserve scrutiny
Total tradesSample sizeEnough trades for the result to mean anything
Recovery factorNet profit divided by maximal drawdownHigher means profit came without huge dips
Expected payoffAverage result per tradeClearly larger than your spread and commission
Equity curve (Graph tab)The path, not just the end pointSteady with normal dips, not a perfectly straight line

Read the drawdown before the profit. A perfectly smooth line with almost no losing trades often means the EA averages down on losers (grid or martingale) or was over-fitted to the past.

How do you avoid overfitting when optimising an EA?

  • Optimise few inputs, over wide steps, rather than dozens of inputs to the decimal.
  • Use a forward period (1/3 or 1/4) and only trust settings that also work on the unseen part.
  • Prefer a broad plateau of good settings over one spectacular peak.
  • Re-test on a different date range and, if you can, another broker's data.

Can you backtest a licensed or free EA?

Often, yes, but it depends on the EA. Some licensed EAs skip or limit their license check inside the tester; others need a test mode from the provider. Ask before you assume. For the EAs in our vault, message support in Telegram and we will tell you how.

What can a backtest not tell you?

It cannot reproduce future markets, your broker's live slippage, VPS outages or your own discipline. Treat it as a filter: reject what fails, then demo-test what passes for two to four weeks, then compare with a live account tracked by an independent service, like the two on our homepage. The full selection checklist is in best gold EA for MT5.

Questions, illuminated

How do I open the Strategy Tester in MT5?

Press Ctrl+R, or click View and then Strategy Tester.

What is the best modelling mode for backtesting in MT5?

Every tick based on real ticks. It uses your broker's real historical ticks and spreads, which matters most for gold and short-term EAs.

How many years should I backtest an EA?

At least one to two years, so the test covers both quiet and volatile markets. Longer is better if good tick data is available.

What is a good profit factor for an EA?

Comfortably above 1 means profits exceeded losses. Very high values on few trades are a warning sign of overfitting rather than a guarantee.

Does a good backtest mean the EA will be profitable?

No. A backtest only shows how the EA behaved on past data. Use it to reject weak EAs, then test on demo and compare with a verified live account.

The bottom line

Backtest with real ticks, realistic deposit and leverage, and at least a year or two of data, then judge drawdown, profit factor and trade count before profit. Use a forward period when optimising, and treat a backtest as a filter: demo and a verified live account come next.

Ready for a free gold EA?Browse the vault, then request it in Telegram.
Explore the EA Vault ↗
Chat with us on Telegram (opens in a new tab)