Before you trust any robot with real money, you have to backtest it. A backtest replays a MetaTrader 5 Expert Advisor over historical prices so you can see how it would have behaved: its profit, its drawdowns and how often it traded. This guide shows you how to backtest an MT5 EA properly in 2026, setting by setting, which numbers in the report matter, what the Strategy Tester cannot simulate, and how to read a result using our own EA’s published tests as a worked example.
This is the verification step we recommend in every guide, including the best MT5 EAs of 2026 and the safe-EA buyer’s guide.
Short answer: to backtest an MT5 EA, open the Strategy Tester (Ctrl+R), pick the EA, symbol and timeframe, choose a long date range with “Every tick based on real ticks” modelling, set a realistic deposit and inputs, and run a single test with optimisation off. Judge profit against maximum drawdown and trade count (100+ trades), check that it holds across several months, then forward-test on a demo before going live.
How do you run a backtest in the MT5 Strategy Tester?
- Open the Strategy Tester – press
Ctrl+Ror choose View → Strategy Tester. - Select the EA from the Expert list. If it is not there, it is not in the Experts folder yet: see how to install an EA on MT5.
- Set the symbol and timeframe – for a gold scalper,
XAUUSDandM5. - Choose a date range long enough to include trending, ranging and news-heavy periods. A year is a reasonable minimum for a scalper.
- Set modelling to “Every tick based on real ticks” if your broker provides tick history.
- Set the deposit, currency and leverage you will really trade, then open the Inputs tab and set the lot or risk. On gold, a small account changes the risk of a fixed lot.
- Leave optimisation off for a single, honest run.
- Click Start, then read the Backtest and Graph tabs.
Which Strategy Tester settings should you choose?
| Setting | What to choose | Why |
|---|---|---|
| Expert | The EA file you will trade | Test the exact version and build you will run live |
| Symbol | Your broker’s symbol, e.g. XAUUSD or XAUUSDm | Spread, contract size and tick history differ by broker and account type |
| Timeframe | The one the EA was built for (M5 for most gold scalpers) | A different timeframe changes every signal |
| Date | A long custom range, ending recently | Several market conditions, including the most recent one |
| Forward | No for a single test; 1/4 or 1/3 when optimising | Holds back data the optimiser never saw |
| Delays | Zero latency for a first run, then a realistic delay | Shows how sensitive the EA is to slower execution |
| Modelling | Every tick based on real ticks | Replays the recorded ticks and spreads |
| Deposit and leverage | Your real balance and leverage | Margin, lot steps and drawdown % all depend on them |
| Optimization | Disabled | One run with fixed inputs is the honest baseline |
| Visual mode | Off for speed; on to watch individual trades | Useful to check the EA does what its description says |
Which modelling mode is most accurate?
MT5 offers five ways to model price. For any EA that uses stops, targets or trailing within a candle, only the first is reliable.
| Modelling mode | What it does | Use it for |
|---|---|---|
| Every tick based on real ticks | Replays the broker’s recorded ticks, with their real spreads | Final decisions, and any scalper |
| Every tick | Generates ticks from one-minute candles | When real ticks are not available; treat results as approximate |
| 1 minute OHLC | Uses only the open, high, low and close of each minute | Quick checks of slower EAs |
| Open prices only | Uses only each bar’s open price | EAs that act only on bar opens; fast optimisation |
| Math calculations | No price data at all | Testing calculations, not trading |
After the test, check History Quality at the top of the report. With real ticks it should be close to 100%. Gaps in the broker’s history lower it, and a low figure means the test skipped real price action.
How do spread and commission work in an MT5 backtest?
Unlike MT4, the MT5 tester has no box to type a fixed spread. In real-tick mode it uses the spread recorded in your broker’s history, so a test on a raw-spread account and a test on a standard account can give very different results for the same EA. Test on the broker and account type you will actually trade. Commission comes from the broker’s symbol settings; if your account pays commission and the test shows none, the result is overstated.
Spread matters most for scalpers. On gold in 2026 the average spread was about $0.18 while an M5 candle averaged $4–9 depending on the hour (see XAUUSD volatility by hour). For a strategy with a small edge, that cost alone can turn a profit into a loss: our test of a classic EMA + RSI gold scalping strategy paid about 3% of its risk in spread on every trade and finished close to breakeven.
Which backtest metrics actually matter?
| Report line | What it tells you | Rough guide |
|---|---|---|
| Total Net Profit | Total gain over the period | Positive, but read it with drawdown |
| Profit Factor | Gross profit ÷ gross loss | >1.3 decent, >1.5 good; near 1.0 = breakeven |
| Equity Drawdown Maximal | Worst fall including open trades | The one prop firms care about; can you live with it? |
| Balance Drawdown Maximal | Worst fall in closed-trade balance | Lower than equity drawdown; don’t quote it alone |
| Total Trades | Sample size | 100+ before the numbers mean much |
| Profit Trades (% of total) | Win rate | Meaningless without average win and loss |
| Average profit / loss trade | Size of a typical win and loss | A high win rate with small wins needs very few losses |
| Maximum consecutive losses | Worst losing streak | Size so you can survive twice this |
| Expected Payoff | Average profit per trade | Must be comfortably above your costs |
| Recovery Factor | Net profit ÷ maximum drawdown | Higher = more profit per unit of pain |
| Sharpe Ratio | Return relative to its volatility | Useful for comparing EAs tested on the same period |
The trap: a huge net profit with a 70% drawdown and only 25 trades is not a good EA. It is a small, lucky (or curve-fitted) sample. Always read profit against drawdown and trade count.
How do you read a backtest report? A worked example
Here is how we read the published tests of our own EA, Gold Scalpers Pro. All are Strategy Tester runs on real XAUUSD ticks, 0.01 lot on a $1,000 deposit; they are backtests, not live results.
| Test period | Net profit | Profit factor | Max drawdown | Trades |
|---|---|---|---|---|
| 14 Sep – 14 Oct 2026 (v4.50 defaults) | +$77.81 | 1.33 | 5.37% | 127 |
| 12 Jan – 14 Sep 2026 | +$99.33 | 1.06 | 25.6% | 727 |
| Within that: 12 Jan – 14 May 2026 | −$181.94 | a four-month losing stretch | ||
- The period changes the verdict. One month looks good (profit factor 1.33, 5% drawdown). Eight months are close to breakeven (1.06) with a 25.6% drawdown, and include a four-month stretch that lost $181.94. Had you only seen the short test, you would have expected far less pain.
- The win rate hides the risk. The one-month test won 83.5% of its trades, yet the average win was $2.99 against an average loss of $11.40. One loss wipes out nearly four wins, so a few bad days decide the month.
- Trade count gives confidence. 727 trades is a solid sample; 127 is a reasonable one. Neither proves the future, but both are far more telling than a 25-trade screenshot.
The full report and the eight-month table are on our backtest results page, and the developer-written review lists the weaknesses.
How do you optimise without curve fitting?
- Run the default inputs first and save that report as your baseline.
- Optimise few inputs, in sensible ranges. Every extra input gives the optimiser more ways to fit noise.
- Use the Forward setting (1/4 or 1/3). MT5 optimises on the first part of the range and then tests the best results on the part it never saw.
- Prefer plateaus to peaks. If an input of 14 is great but 13 and 15 are poor, the result is luck. Choose values where the neighbours also work.
- Re-test the chosen inputs on a different period with real ticks before you trust them.
What can’t the MT5 Strategy Tester simulate?
- News filters that read the economic calendar. The tester cannot replay MT5 calendar events, so these filters are effectively off. A backtest of such an EA includes trades it would have skipped live around news. (This applies to our EA too: its published backtests include news-time trades.)
- Anything that needs the internet. WebRequest calls are blocked in the tester, so licence checks, AI features, web news and Telegram messages do not run.
- Your real fills. Real ticks replay the market, not your orders. Slippage on fast moves, requotes and partial fills are not reproduced; the Delays setting is only an approximation.
- Future broker conditions. Spreads, commissions, swaps and leverage change. A test reflects the conditions recorded in the history.
This is why the gap between a backtest and a live account is normal, and why the next step matters.
7 common backtesting mistakes
- Curve fitting – optimising inputs until the past looks perfect. It will not repeat.
- Testing on the wrong account type – a raw-spread test overstates a standard account, and vice versa.
- Forgetting commission – it erodes scalping edges fast.
- Too short a period – a few months cannot show how an EA handles different conditions.
- Low-quality modelling – Open prices only is fine for a glance, misleading for decisions.
- Reading the win rate on its own – always compare average win and average loss.
- Trusting the backtest alone – see below.
Why forward-test on demo after a backtest?
A backtest is necessary but never sufficient. After a solid long backtest, forward-test on a demo account with your own broker for at least a month, or until the EA has taken enough trades to compare with the backtest. Check that the trade frequency, average win and loss and drawdown look like the test. Then go live with a small size under the 1% risk rule, ideally on a VPS so MT5 stays running. This is the same honest sequence we recommend instead of trusting advertised win rates; see EA vs manual trading.
How do you backtest Gold Scalpers Pro?
Gold Scalpers Pro carries its three indicators (the Slope Direction Line, a ZeroLag MACD and the 50 EMA) inside the EA file, so it runs in the Strategy Tester with no extra files and no “indicator not found” errors. The licence check is skipped in the tester, so you can test before you activate anything.
- Symbol
XAUUSD(your broker’s name for gold), timeframeM5, modelling Every tick based on real ticks. - A recent range of at least several months; our eight-month test used 12 Jan to 14 Sep 2026.
- FixedLot 0.01 per $1,000 of deposit to compare with our published figures.
- Remember the news filter and the optional AI news trading do not run in the tester, as explained above.
Then demo-test it on your own broker. That is the point: judge it on your own data, not our word. The settings guide explains each input.
Frequently asked questions
How do I backtest an EA in MetaTrader 5?
Open the Strategy Tester (Ctrl+R), pick the EA, symbol and timeframe, set a long date range with 'Every tick based on real ticks' modelling, enter a realistic deposit, leverage and inputs, leave optimisation off, then run. Read the report's profit factor, drawdown, number of trades and equity curve, not just net profit.
What is a good profit factor for an EA?
Above 1.3 is decent and above 1.5 is good, but only over 100 or more trades, several market conditions and realistic costs. A profit factor near 1.0 means the EA is close to breakeven.
Which modelling mode should I use in the MT5 Strategy Tester?
'Every tick based on real ticks' whenever your broker provides tick history. It replays recorded ticks and spreads. '1 minute OHLC' and 'Open prices only' are faster but can badly misjudge stops and targets on scalping EAs.
How many trades does a backtest need?
At least 100, and more is better. Fewer trades can look excellent by luck. Also check that the result holds across several months, not one good stretch.
Can I set the spread in the MT5 Strategy Tester?
Not directly as in MT4. In real-tick mode MT5 uses the spread recorded in your broker's history, so test on the same broker and account type you will trade. To test a different spread you need a custom symbol.
Can the Strategy Tester test news filters?
Not when the filter reads the MT5 economic calendar, because the tester cannot replay calendar events. WebRequest calls are also blocked in the tester. Any EA feature that depends on live news or web data is effectively off in a backtest.
Is backtesting enough before going live?
No. Forward-test on a demo account with your own broker for at least a month, or until the EA has taken a meaningful number of trades, then go live with a small size.