You’ve got an EA, maybe a free one, and you want to know if it’s any good before it touches your account. The MT5 Strategy Tester gives you a beautiful curve in thirty seconds. That’s the problem. Knowing how to backtest an EA on MT5 is mostly knowing which of those thirty seconds lied to you.
This is the routine I use before I trust any EA, mine included. It’s what I ran on The Gold Reaper for my last review, and the same settings apply to anything you test.
Step 1: pick a modelling mode that matches the EA
The tester can feed your EA prices in different ways. From the MetaTrader 5 documentation:
- Every tick based on real ticks: uses real ticks accumulated by the broker, with no simulation. The closest you’ll get to live conditions.
- Every tick: all ticks are simulated. Accurate but slower, and still simulated.
- 1 minute OHLC: only four prices of each minute bar (open, high, low, close) are emulated.
- Open prices only: only the bar’s open price is used. Fine for EAs that only act at the open of a bar, misleading for anything else.
My rule: run the long history on 1 minute OHLC or every tick, then cross-check a recent window on real ticks. If the two disagree a lot, believe the real ticks. On The Gold Reaper, the real-tick window lowered the win rate from 78.26% to 71.38% and raised the money drawdown from $219.57 to $243.74. Worse, which is normal, but no collapse. That’s the kind of gap you can live with.
Step 2: use the broker you’ll actually trade
The tester doesn’t model the spread: it takes it from the historical data, and treats it as floating. If the history has a zero or negative spread, the tester uses the last known one. So your result is only as good as the broker’s history. Test on the server you’ll trade on. I run mine on Axi data because that’s where my accounts are. Affiliate link; I may earn a commission if you open an account through it.
Check the History Quality line in the report. Low quality means gaps, and gaps flatter results.
Step 3: add execution delay
With no delay, every order fills at the requested price with no requotes. Live trading never works like that. The tester can emulate a fixed delay or a random one: in random mode, there’s a 90% chance of a 0 to 8 second delay and 10% of 9 to 18 seconds. If your EA scalps or trades the news, test it with delay. If the result dies, it would have died live too.
Step 4: test at the size you’ll trade
Set the deposit and leverage to what you’ll really use, and pay attention to how the EA sizes trades.
With fixed lots, a drawdown is a dollar amount that doesn’t care about your balance. On The Gold Reaper, the stress-tested drawdown at fixed minimum lots was about $574. That’s 14.3% of a $4,000 account and 95.6% of a $600 one. Same EA, same trades, very different risk. Test at your balance, not at the one in the screenshot.
Step 5: read the right drawdown
The report gives you several drawdowns, and they answer different questions:
| Report line | What it measures |
|---|---|
| Balance drawdown absolute | How far the balance fell below the initial deposit |
| Balance drawdown maximal | The biggest fall from a balance peak, in money |
| Balance drawdown relative | The biggest fall from a balance peak, in percent |
| Equity drawdown (same three) | The same, including open trades. Usually worse, and closer to what you’ll feel |
Balance drawdown hides losing trades that were still open. Always look at equity. And for planning, I also measure drawdown as a percentage of the starting capital at each daily close, because that’s what a daily loss rule at a prop firm looks at.
While you’re in the report: profit factor is gross profit divided by gross loss, and recovery factor is profit divided by the maximum drawdown. A great profit factor on 40 trades means very little. Look at the number of trades before you look at anything else.
Step 6: keep a period the EA has never seen
If you optimise, the best parameter set will always look great on the data it was chosen from. That’s overfitting, and I explained how it works in why perfect EA backtests lose money.
MT5 has a built-in answer: the forward period. You can reserve 1/2, 1/3 or 1/4 of the history, or set a custom start date. The tester then re-runs the best results on that unseen part: 10% of the best runs in a full search, 25% with the genetic algorithm. Judge the EA on the forward tab, not the optimisation tab.
Step 7: stress the result, because history is one path
Your backtest is one sequence of trades that happened once. A small change in order or luck gives a different drawdown. When I stressed The Gold Reaper 1,000 times, two out of three scenarios went deeper than its historical 8.46%, and the 95th percentile landed at 14.34%. The curve showed eight and a half; I’d plan for closer to 14.
You don’t need my engine to do a version of this. A spreadsheet Monte Carlo on your exported trade list gets you most of the way: Monte Carlo simulation for trading shows you how. If you want to see what the full stress test looks like on a real EA, open The Gold Reaper MT5 analysis.
Watch what changes between a backtest and a live account: in Why Most Trading Bots Fail Live, I go through the gaps a tester can’t show you.
What the MT5 Strategy Tester can’t test
Some EAs can’t be backtested at all. Functions that talk to the outside world, including WebRequest, aren’t executed in the Strategy Tester. Any EA that asks an AI model for its decisions through an API needs a forward test on demo instead. Here’s what to record in an AI forward test.
And if you’re testing a discretionary idea rather than an EA, the tester isn’t the right tool either. Manual backtesting without choosing the winning trades covers that.
How to backtest an EA on MT5: my checklist before I trust one
- Long history on 1 minute OHLC or every tick, recent window on real ticks.
- Broker history I’ll actually trade, with decent History Quality.
- Delay on, if the EA is fast.
- Deposit and sizing at my real balance.
- Equity drawdown, and drawdown on starting capital at the daily close.
- Enough trades to mean something.
- A forward period it never saw.
- A stress test, and I plan for the 95th percentile, not the history.
That’s how to backtest an EA on MT5 so the result means something. Then demo. Always demo. A backtest earns an EA the right to a demo account, nothing more.
If your plan includes trading allocated capital later, check the programme’s rules on automated trading before you build around them. My Axi Select overview is a starting point.
I break a new EA with this routine every few weeks. If you want the next one first, join the DoItTrading newsletter.
Backtests are historical simulations, not forecasts. Trading involves real risk to capital.
Frequently Asked Questions
Which modelling mode should I use in the MT5 Strategy Tester?
Every tick based on real ticks is the closest to live trading, because it uses the broker’s real ticks without simulation. For long histories, 1 minute OHLC or every tick is a practical start, followed by a real-tick check on a recent window.
Why is my live result worse than my MT5 backtest?
Usually a mix of spread, execution delay, slippage and overfitting. The tester takes spreads from history and fills with no delay unless you add one, and an optimised parameter set rarely performs as well on new data.
Which drawdown in the MT5 report should I trust?
Start with equity drawdown, because balance drawdown ignores open losing trades. For planning, also measure drawdown as a percentage of starting capital and stress it, since history is only one path.
Can I backtest an AI EA in MT5?
Not if it calls an external API. WebRequest isn’t executed in the Strategy Tester, so AI EAs that ask a model for decisions have to be forward tested on a demo account.
How do I avoid overfitting when I optimise an EA?
Reserve a forward period with MT5’s forward option and judge the parameters only on that unseen data. Fewer parameters and more trades also make the result harder to fool.