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 on a laptop with equity curve and trade log visible

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:

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:

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:

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:

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:

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.
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

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.

Keep going: Audit Methodology Index Index