Insight2 min read
How to Backtest an EA in MT5: A Complete Tutorial
Always backtest in your own environment before going live. A step-by-step on the MT5 Strategy Tester and the backtest traps to avoid.
TopXEA Trading Desk

Contents
The same EA can behave completely differently across brokers due to spread, slippage and swap. So don't rush a fresh EA to a live account — run it through the MT5 Strategy Tester in your own environment first.
Step 1: Open the Strategy Tester
In MT5 press Ctrl+R to open the Strategy Tester. Pick the EA, the symbol (e.g. XAUUSD) and the timeframe.
Step 2: Choose the right modeling quality (the key step)
Set modeling to "Every tick based on real ticks" — the closest thing to reality. A pretty curve from low-quality modeling is worthless; this is where many people fool themselves.
Step 3: Set period, deposit and leverage
- Period: start with the last 2–3 years to cover different regimes.
- Deposit & leverage: use the same settings as your live account, or the result is meaningless.
- Spread: use realistic spread, not an artificially low fixed one.
Step 4: Read the right metrics, not just profit
- Maximal Drawdown — more important than net profit; decides whether you can hold on.
- Profit factor / return-to-drawdown — the risk-adjusted quality.
- Number of trades — too few means no statistical significance.
Step 5: Compare against the live signal
Compare the backtest curve's shape with the real live signal on the product page — the smaller the gap, the more credible. A big gap means investigate: spread, modeling quality, timezone and symbol suffix (e.g. XAUUSD.r needs adjusting in inputs). Why live beats backtest: here.
Common traps
- Low-quality modeling + fixed low spread producing a "perfect" curve.
- Only testing the recent bull run, dodging ranges and drawdown periods.
- Over-optimizing parameters to fit history (curve-fitting) — guaranteed to break live.
Once the backtest is stable, run it on demo for 1–2 weeks, then go live with a small account. Full install & VPS tips: user guide; prefer hands-off? See managed accounts.
Risk note: backtest results do not represent live performance, which is also affected by slippage, liquidity and spread changes; trading is risky — use money you can afford to lose.
Keep reading
Same EA, same .set, two different equity curves. We isolated the chart timeframe in a controlled test: 60× the bar count, and every figure in both reports came back identical. The variables that actually move the number are elsewhere — ranked by impact, with our own measured data.
Quantum Queen X v4.3 ships 51 literal historical dates baked into its source: 24 on which it refuses to trade, 8 that multiply the take-profit by 15, and 19 that multiply it by 5. All are past dates and the last sits right at the build date — they can only rewrite backtests, never a future session. Here is the original code, line by line, and why this is cheating rather than optimisation.
UBS runs dozens of independent breakout sub-strategies from a single chart. Live at 11 weeks: +16.18%, 543 trades, profit factor 1.27, 11% max drawdown. More important than the numbers: without the autoloader your backtest will be wrong — which is how this EA gets misjudged.