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 28 July 2026 · 8 min read · PipTax education

If you want to know whether an expert advisor stands any chance before you risk real money, you need to backtest an EA in the MT4 Strategy Tester and read the results with a sceptical eye. Done properly, it's one of the most useful habits in an EA trader's routine. Done badly — with poor data and zero regard for spread — it's a fast way to convince yourself a bad system is a good one.

What the MT4 Strategy Tester Actually Does

The Strategy Tester is a built-in MT4 module that replays historical price data and runs your EA against it exactly as if it were live, tick by tick or bar by bar depending on the model you choose. It then reports trades, profit, drawdown, and a handful of performance stats.

It's useful because it lets you:

What it can't do is prove an EA will be profitable live. Historical data doesn't repeat, execution isn't identical, and MT4's own modelling has known weaknesses — particularly around spread and slippage. Treat it as a filter for obviously broken strategies, not a crystal ball.

Setting Up the Test Correctly

Open MT4, go to View > Strategy Tester (or press Ctrl+R). From there:

1. Expert Advisor — select the EA you want to test from the dropdown. 2. Symbol — pick the pair the EA is designed for. Don't test a EURUSD scalper on Gold and expect meaningful results. 3. Period — choose the timeframe the EA actually trades on, not just the chart you happen to have open. 4. Model — this is the setting most people get wrong (see below). 5. Dates — tick "Use date" and set a realistic range, ideally several years. 6. Spread — set to "Current" only if you understand what that means for your broker, or set a fixed value that reflects realistic typical spread for that pair.

Before running anything, open the EA's Inputs tab and check lot sizing, risk settings, and any magic numbers. Running a test with default demo settings on a live-sized account is a common beginner mistake.

Choosing the Right Modelling Method

MT4 offers three modelling options, and the difference between them matters more than most traders realise:

| Model | How it works | Best for | |---|---|---| | Every tick | Simulates real tick-by-tick price movement | Scalpers, tight stops, most serious tests | | Control points | Interpolates between available minute bars | Reasonable middle ground when tick data is thin | | Open prices only | Uses only the opening price of each bar | Quick sanity checks, not final judgement |

If you're serious about backtesting an EA in the MT4 Strategy Tester, use Every tick wherever your historical data allows it. "Open prices only" can pass a strategy that would fail instantly on real intrabar movement, especially anything using stop losses tighter than a few pips.

Historical Data Quality: The Part Everyone Skips

Your backtest is only as good as the price history behind it. MT4's default history centre data is often thin or has gaps, particularly for older periods or less common symbols.

Before trusting any result:

Poor data doesn't just produce noisy results — it can produce systematically biased ones, usually flattering the EA. That's the dangerous direction to be wrong in.

Reading the Results Without Fooling Yourself

Once the test finishes, MT4 gives you a Results tab and a Report. The numbers that matter most:

Watch out for curve-fitting: if the EA was optimised on the exact same data you're now testing on, of course it looks good. That's not validation — that's the strategy memorising the past. A fairer approach is to optimise on one period and test, unseen, on a separate later period.

From Backtest to Real Broker Costs

A backtest with an unrealistic spread assumption is one of the most common ways traders overestimate an EA's edge. Many default tests run at zero or minimal spread, which flatters short-term and high-frequency strategies enormously.

To close that gap:

An EA that only survives on a zero-spread backtest won't survive live. This is also where our [methodology](/methodology.html) page is worth a read — it explains how we treat cost data so you're comparing like with like.

Conclusion: Backtesting Is a Filter, Not a Verdict

Learning to backtest an EA in the MT4 Strategy Tester properly — good data, realistic spread, honest date ranges, and scepticism about optimised results — turns it from a false-confidence machine into a genuinely useful filter. Use it to reject the obviously broken EAs quickly, then move anything promising to a demo account for forward testing under live conditions before any real capital gets involved. Pair every backtest with a look at real broker costs, because the gap between a zero-spread test and live trading is exactly where most EAs quietly fail. For structured lessons on testing and risk, the [trading school](/school/index.html) is a good next stop.

Key takeaways

  • The MT4 Strategy Tester lets you replay an EA against historical price data before risking real money on it
  • Backtest quality depends almost entirely on your data: use tick data where possible, not 'Open prices only'
  • Always model spread and swap realistically — a backtest with zero spread is close to meaningless
  • Run tests across different market conditions (trending, ranging, high-volatility news periods) not just one lucky year
  • A clean backtest is a starting point, not proof — pair it with forward testing on a demo account and real broker cost data
  • Use the cost tool to see how your live broker's spreads and swaps would actually affect the strategy's results
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 backtesting accurate enough to trust with real money?
It's a useful filter, not a guarantee. MT4's tester can misrepresent slippage and variable spread, especially with poor-quality historical data. Treat a good backtest as permission to forward test on demo, not permission to go live.
What's the difference between backtesting and optimisation in MT4?
Backtesting runs your EA once with fixed settings over a date range. Optimisation runs it many times with different input values to find the combination with the best historical result. Optimisation is far more prone to curve-fitting, so treat optimised results with extra scepticism.
Why does my backtest show different results to live trading?
Common causes are unrealistic spread/execution modelling, gaps in historical data, differences between your broker's real spreads and what the tester assumes, and the EA behaving differently under live slippage and requotes. This is why forward testing and checking real broker costs matter.
Should I use tick data or 1-minute data for backtesting an EA?
Tick data (real ticks or a good tick generator) gives the most realistic fills, especially for EAs that trade on short timeframes or use tight stop losses. 1-minute OHLC modelling is acceptable for slower strategies but 'Open prices only' should be avoided for anything serious.
How long a history should I test an EA over?
Ideally several years covering different market regimes — trending, ranging, and at least one high-volatility period. A few months of data, or a period cherry-picked because it looks good, will give you a false sense of confidence.

Keep going: Audit Cost Impact Methodology Index