How to Backtest an EA in the MT4 Strategy Tester
If you want to know whether an automated strategy has any merit before risking real money, you need to backtest an EA in the MT4 Strategy Tester properly — not just click "Start" and hope for a green equity curve. Done well, this process gives you an honest, if imperfect, picture of how a strategy has handled real market conditions. Done badly, it produces a fantasy result that falls apart the moment you go live.
This guide walks through the practical steps, the settings that matter, and the common mistakes that make backtests lie to you.
Setting Up the MT4 Strategy Tester Correctly
Open the Strategy Tester in MT4 via View > Strategy Tester (or Ctrl+R). Before you run anything, get the basics right:
- Expert Advisor: select the compiled EA from the dropdown.
- Symbol: match the exact pair your broker lists (e.g. some brokers use "EURUSDm" or similar suffixes).
- Period: pick the timeframe the EA is designed for — check the EA's documentation, don't guess.
- Model: choose "Every tick" for the most granular simulation (more on this below).
- Dates: tick "Use date" and set a realistic start and end range — ideally several years.
- Spread: set this to "Current" only if you're testing right now with live conditions in mind; otherwise enter a fixed value that reflects typical spreads, or better, use variable spread from tick data.
Also check Visual mode if you want to watch trades trigger bar-by-bar during development — useful for debugging entry logic, though slower than a straight run.
Getting these fields wrong is the single biggest reason backtests mislead traders, so treat this setup step as seriously as the strategy logic itself.
Choosing the Right Modelling Quality
MT4 offers three modelling options, and the difference between them matters more than most traders assume:
| Mode | What it does | Accuracy | Speed | |---|---|---|---| | Every tick | Rebuilds ticks from available data at highest resolution MT4 can manage | Highest available in MT4 | Slowest | | Control points | Uses a subset of price points, interpolates the rest | Medium | Faster | | Open prices | Only uses the open of each bar | Lowest | Fastest |
For any serious evaluation, use Every tick. It's slower, sometimes painfully so on years of M1 data, but Control points and Open prices can miss intrabar price action entirely — meaning stop-loss and take-profit triggers, or fast scalping entries, may never fire the way they would in reality. If your EA trades off M1 or ticks directly, data quality becomes even more critical, since MT4's built-in history is only as good as what your broker's server stored.
Sourcing Good Historical Data
The Strategy Tester is only as reliable as the price history behind it. Before trusting any result:
- Download extended history via Tools > History Center, or through your broker's own MT4 server (Pepperstone and IG both provide reasonably deep history through their servers).
- Check for gaps — missing days or suspicious flat periods usually mean incomplete data, which will silently distort results.
- Consider third-party tick data providers if you need multi-year, tick-level accuracy beyond what your broker stores.
- Match the account type — history and typical spread behaviour can differ between a broker's standard and raw/ECN account types.
Poor data doesn't just make results less accurate — it can make a bad strategy look brilliant, or a genuinely sound one look worthless. Treat data sourcing as a first-class step, not an afterthought.
Modelling Real Trading Costs
This is where most backtests go wrong. A default MT4 test often assumes a flat, favourable spread and no commission at all — which flatters almost any strategy.
To model costs properly:
- Enter a realistic spread in the tester settings rather than leaving it at a generic default.
- Add commission manually if your EA trades an account type that charges it (many ECN/raw accounts do) — MT4's tester doesn't always apply this automatically depending on version.
- Factor in swap for any EA that holds positions overnight; ignoring swap can badly distort results for longer-held trades.
- Cross-check assumptions against real, current numbers using PipTax's [cost audit tool](/audit.html) rather than guessing — spreads and commissions vary by broker and account type, and change over time.
Never take a headline "profitable" backtest at face value until you've confirmed the cost assumptions inside it roughly match what you'd actually pay live. A strategy that only works with zero spread and no commission isn't a strategy — it's a spreadsheet trick.
Running Optimisation Without Curve-Fitting
MT4's Optimization tab lets you test ranges of input values automatically. It's a powerful tool, but also the easiest way to fool yourself.
Good practice:
- Test broad ranges of each parameter, not narrow ones tuned around a value you already suspect works.
- Look for plateaus, not peaks — a setting that performs reasonably across a wide range is more trustworthy than one isolated spike of profitability.
- Split your data: optimise on one period, then validate on a separate, unseen period (out-of-sample testing).
- Limit the number of variables you optimise simultaneously — the more knobs you turn, the easier it is to fit noise rather than signal.
If your best-performing setting only works for one narrow date range or one specific parameter combination, treat it with suspicion. Genuine edge tends to survive reasonable changes in settings and time period; curve-fit results usually don't.
Reading and Interpreting the Results
Once a backtest is complete, MT4 generates a report with dozens of statistics. Focus on the ones that actually tell you something useful:
- Total net profit vs gross profit/loss — check the ratio, not just the headline number.
- Profit factor — gross profit divided by gross loss; above 1 is required, but treat anything wildly high with scepticism.
- Maximum drawdown — both in currency and percentage; this tells you what you'd need to survive psychologically and financially.
- Number of trades — too few trades (say, under 100) makes any statistic unreliable.
- Equity curve shape — a smooth, gradually rising curve is far more reassuring than one with a single outsized win propping up the whole result.
Cross-reference all of this against your actual cost structure, and consider running the same EA logic and settings across a demo account for a few weeks before going live — forward testing catches problems a backtest can hide entirely.
Conclusion
Learning to backtest an EA in the MT4 Strategy Tester properly — with accurate data, realistic spread and commission, sensible date ranges, and honest interpretation of the results — is one of the most valuable skills an automated trader can build. It won't guarantee future performance, and trading always carries risk regardless of how convincing a backtest looks. But a careful, cost-aware backtest is far better than blind faith in an EA's marketing claims. Before committing capital, check your assumptions against live broker numbers on the [cost audit tool](/audit.html), compare account types on the [brokers page](/brokers/index.html), and if you want a structured refresher on testing methodology, the [school section](/school/index.html) and our [methodology page](/methodology.html) are worth reading first.
Key takeaways
- The MT4 Strategy Tester lets you replay historical price data to see how an EA would have performed, but results are only as good as your data quality and settings.
- Always test on 'Every tick' modelling with real broker spread data where possible, not the default fixed spread.
- A backtest that ignores spread, commission and swap will overstate profitability — check these against live costs on the cost tool before trusting any result.
- Run tests across multiple market conditions (trending, ranging, volatile) and multiple years, not just one lucky period.
- Optimisation should be used to understand sensitivity, not to hand-pick the single best-looking parameter set (curve-fitting).
- Forward test on a demo account before committing real money, since live execution rarely matches backtest conditions exactly.
Frequently asked questions
- Do I need real tick data to backtest an EA in MT4 accurately?
- Not strictly, but it helps a lot. MT4's default modelling generates ticks from OHLC bars, which is less accurate than genuine tick-by-tick history. Many brokers, including Pepperstone, let you download better history via their servers, or you can import third-party tick data. Better data means a more realistic backtest, though it will never perfectly replicate live conditions.
- Why does my backtest show great results but the EA loses money live?
- This is usually down to unrealistic assumptions in the test: fixed or zero spread, no slippage, no commission, or a data set with gaps. It can also be curve-fitting, where parameters were tuned to fit past data rather than a genuinely robust strategy. Always compare backtest cost assumptions against real spreads and commissions on the cost tool before drawing conclusions.
- What is the difference between 'Every tick' and 'Control points' modelling?
- Every tick simulates the most granular price movement MT4 can generate from your available data and is the most accurate but slowest. Control points and Open prices only use a fraction of the available price information, running faster but giving a rougher, less reliable picture of how trades would have triggered.
- Can I trust the optimisation results in MT4's Strategy Tester?
- Use optimisation to see how sensitive an EA is to its inputs, not to pick the single best historical result. A parameter set that only worked because of one unusual data quirk is unlikely to repeat. Look for ranges of settings that perform reasonably, not just one narrow peak.
- How much history should I use when I backtest an EA in the MT4 Strategy Tester?
- Aim for several years covering different market regimes — trending, ranging and high-volatility periods. A test over a few months of calm price action tells you very little about how the EA copes with a news-driven spike or a prolonged range.