CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. Most retail investor accounts lose money when trading CFDs. PipTax is educational and compares costs; it is not investment advice.

HomeLearn › Tutorials

How to Backtest an EA in the MT4 Strategy Tester

Updated 14 July 2026 · 8 min read · PipTax education

Trader reviewing MT4 Strategy Tester results and equity curve on a laptop screen

If you want to know whether an expert advisor is worth running on a live account, you need to backtest an EA in the MT4 Strategy Tester before risking a single pound. It's the built-in, free way to see how a strategy would have performed on historical data — but only if you set it up properly, because sloppy settings can make a poor EA look brilliant, or a decent one look useless.

What the MT4 Strategy Tester Actually Does

The Strategy Tester replays historical price data through your EA's code exactly as if it were trading live, bar by bar or tick by tick, and logs every simulated trade. At the end you get:

It's accessed via View > Strategy Tester (or Ctrl+R) in MT4. You pick the EA, the symbol, the timeframe, the date range, and the modelling method, then hit Start.

This is genuinely useful for filtering out bad ideas quickly and cheaply. It is not a guarantee of future performance — market conditions change, and no backtest can fully capture live execution quirks like requotes or slippage during news spikes.

Getting Your Historical Data Right

Backtest quality lives or dies on the history data behind it. MT4's default data (via Tools > History Center) is often incomplete for older periods or less popular pairs, especially on demo servers.

Before you run anything:

1. Check data availability in the History Center for your chosen symbol and timeframe 2. Download more history if needed — some brokers offer deeper archives via their MT4 server, and third-party data providers exist too 3. Look at the Journal tab after a first test run — it will flag "no data" gaps or missing periods 4. Match the broker — data quality genuinely varies between servers, so testing on Pepperstone's MT4 history and testing on IG's MT4 history won't necessarily produce identical results, since feeds and available depth differ

A backtest built on patchy data isn't a backtest — it's a guess with an equity curve attached.

Choosing the Right Modelling Method

MT4 offers three modelling options, and this choice matters as much as the EA's own logic:

| Method | Speed | Realism | Best for | |---|---|---|---| | Every tick | Slowest | Highest | Final validation, scalping/intraday EAs | | Control points | Medium | Medium | Quick mid-stage checks | | Open prices only | Fastest | Lowest | Rough first-pass filtering only |

For anything you're seriously considering running live, use Every tick. It reconstructs sub-minute price movement from your available history and gives the EA a realistic sequence of prices to react to within each bar — crucial for strategies with tight stops or fast entries/exits. Open prices only is fine for a five-minute sanity check on a brand-new idea, but don't base a go-live decision on it.

Setting Realistic Spread and Cost Assumptions

This is where a lot of promising-looking backtests fall apart in live trading. The Strategy Tester lets you set spread as a fixed value in points or use "current spread." Fixed value is the sensible choice for historical testing, since current spread only reflects the moment you run the test, not the conditions during your test period.

To keep this realistic:

Skipping this step is the single most common reason backtested EAs disappoint traders once they go live.

Running the Test and Reading the Report

Once your symbol, timeframe, date range, spread, and modelling method are set, click Start. When it finishes, focus on more than just the net profit figure:

Always check the equity curve visually. A smooth upward slope is more trustworthy than an equity curve that's flat for months and then spikes on one or two huge trades — the latter often signals a strategy overly dependent on rare conditions.

Avoiding the Optimisation Trap

MT4's built-in Optimisation feature lets you test ranges of input parameters automatically to find the "best" combination. It's tempting — and dangerous if used carelessly, because it's very easy to curve-fit a strategy to historical noise rather than find a genuine edge.

To use it responsibly:

For a deeper look at how to structure a testing process end to end, PipTax's [methodology page](/methodology.html) and the broader [trading school](/school/index.html) walk through validation frameworks in more detail.

Conclusion: Make the Backtest Earn Your Trust

Learning to backtest an EA in the MT4 Strategy Tester properly — good data, every-tick modelling, realistic spread, and honest reading of the report — turns it from a box-ticking exercise into a genuine filter for bad strategies. Once a backtest survives realistic costs and out-of-sample validation, the next sensible step is forward-testing on a demo account before committing real capital, and checking your actual broker's live costs via the [cost audit tool](/audit.html) so nothing is left to guesswork. Trading always carries risk, and no backtest, however careful, removes that.

Key takeaways

  • The MT4 Strategy Tester is free and built into every MT4 install — no extra software needed to get started
  • Data quality (modelling method and history depth) matters more than the EA's settings for trustworthy results
  • 'Every tick' modelling is slower but far more realistic than 'Open prices only' for most strategies
  • Always set a realistic spread and check swap/commission assumptions separately, since backtests often understate real costs
  • Optimisation results are prone to curve-fitting — validate on out-of-sample data before trusting a parameter set
  • Live demo forward-testing is the natural next step after a clean backtest, before any real money is risked
Want the real number for how you trade? Audit your MT4/MT5 statement free — see your true all-in cost and the genuinely cheapest broker for your style.

Frequently asked questions

Is MT4 Strategy Tester accurate enough to trust?
It can be reasonably accurate if you use 'Every tick' modelling with good quality history data and realistic spread/commission settings. It's still a simplification of live market conditions, so treat results as an indication, not a guarantee, and always forward-test on a demo account before going live.
Why do my backtest results look better than live trading?
This usually comes down to unrealistic spread assumptions, missing swap/commission costs, curve-fitted parameters, or poor-quality historical data with gaps. Re-run the test with your actual broker's typical costs pulled from a cost comparison tool, and check the Journal tab for data errors.
What's the difference between 'Every tick' and 'Open prices only' modelling?
'Open prices only' only simulates price movement on the opening of each bar, which is fast but crude and can badly misrepresent EAs that react within a bar. 'Every tick' reconstructs sub-minute price movement from your history data, giving a much more realistic — though slower — simulation.
How much historical data do I need for a reliable backtest?
As a rough guide, test across several different market conditions — trending, ranging, and volatile periods — ideally covering at least 2-3 years of data where available. A short, one-directional sample can make a mediocre EA look far better than it is.
Can I backtest with real spread instead of a fixed value?
Yes, MT4 lets you select 'Current spread' or a fixed value in points. Current spread pulls live spread at the time you run the test, which isn't representative of history, so most traders set a realistic fixed value based on their broker's typical spread from a live cost tool.

Keep going: Audit Index Methodology Index