How to backtest a Forex EA in MT4 (Strategy Tester walkthrough)
Before risking real money, replay your EA against historical ticks. A step-by-step MT4 Strategy Tester guide: what to set, which report numbers actually matter, and how to avoid curve-fitting.
Why backtest before you trade
Before you attach any EA to a live XAUUSD chart and let it risk real money, you owe yourself one hour in the MT4 Strategy Tester. Backtesting replays your EA against historical ticks so you can see its worst drawdown, its average trade, and whether it survives a news spike โ without lighting up your account. If you have not installed the EA yet, start with how to install an EA on MT4.
Open the Strategy Tester
In MetaTrader 4: View โ Strategy Tester (or press Ctrl+R). The panel docks at the bottom.
- Expert Advisor โ pick your EA from the dropdown.
- Symbol โ choose the exact pair it trades (XAUUSD, EURUSDโฆ). Testing GBPUSD settings on EURUSD is meaningless.
- Period โ use the timeframe the EA was designed for (M1, M5, H1). The EA's logic is period-specific.
- Model โ choose Every tick for accuracy. "Open prices only" is faster but hides the slippage and spread behaviour that decide real results.
- Dates โ cover at least 12 months, and include a volatile stretch (a major news period). An EA that only looks good in a calm 3-month window is a trap.
- Deposit โ set it to your evaluation start balance so the lot math matches the risk settings you will actually use.
- Tick Use date and leave Optimization off for the first run. Click Start.
Read the report, not the profit number
The green "Net profit" line is the least important. Look at:
- Max drawdown (%) โ the peak-to-trough equity loss. This is the number that blows prop-firm accounts. If max DD is 18% and your firm caps you at 10%, the EA will fail evaluation even if it is "profitable".
- Profit factor โ gross profit รท gross loss. Above 1.5 is workable; below 1.2 is a coin flip after costs.
- Recovery factor โ net profit รท max drawdown. Higher means the EA earns its risk back faster.
- Trades / On-time % โ fewer than ~100 trades means the stats are not yet trustworthy.
- Consecutive losses โ the worst losing streak tells you how big a daily-loss buffer you need.
The trap: overfitting
A common mistake is "optimizing" every input until the curve is a smooth upward line, then wondering why live trading loses. That is curve-fitting โ the EA memorized history instead of trading it. Guard against it:
- Test on data the optimization did not see (split your window: optimize on the first half, validate on the second).
- Keep inputs close to the EA author's defaults unless you have a reason to change them.
- Be suspicious of profit factors above ~3 on a single pair with hundreds of trades โ that is often a fitted artifact, not edge.
From backtest to a real decision
A good backtest does not promise live profit โ spread, slippage, and broker execution differ from the tester. But it does two things that matter: it proves the EA has a drawdown you can survive, and it shows you the worst losing streak so you can size lot and daily cap correctly. Browse the EAs in the store once you know the risk profile you can tolerate.
Risk disclaimer: Backtesting shows past behaviour, not future results. Forex and CFD trading with leverage can lose more than your deposit. Never trade live on a backtest alone โ validate on a demo account first.