Methods & practice2 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.

In this article6
  1. Step 1: Open the Strategy Tester
  2. Step 2: Choose the right modeling quality (the key step)
  3. Step 3: Set period, deposit and leverage
  4. Step 4: Read the right metrics, not just profit
  5. Step 5: Compare against the live signal
  6. Common traps

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.

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.