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 1 September 2026 · 8 min read · PipTax education

If you want to backtest an EA in the MT4 Strategy Tester properly, you need more than just hitting "Start" — the quality of your data, your modelling settings, and your cost assumptions all decide whether the results mean anything at all. Get those wrong and you'll build false confidence in a strategy that was never actually profitable.

This guide walks through the practical steps: setting up the tester, choosing modelling quality, feeding in realistic costs, and reading the results without fooling yourself.

Setting Up the MT4 Strategy Tester Correctly

Open the Strategy Tester in MT4 (View → Strategy Tester, or Ctrl+R). Before running anything, check these settings:

Also confirm your initial deposit and leverage match a realistic account size — testing with £100,000 when you'd actually trade £2,000 changes position sizing behaviour and can hide margin issues.

Choosing the Right Modelling Quality

MT4 offers three modelling options, and they are not interchangeable:

| Mode | How it works | Best for | |---|---|---| | Every tick | Reconstructs sub-minute price movement from the smallest data available | Final validation, final go/no-go decision | | Control points | Samples fewer price points, interpolates between them | Quick sanity checks | | Open prices only | Uses only the open price of each bar | Very fast scans of many settings |

For any serious decision — before you fund a live account or hand an EA real money — run the full test in Every tick mode. It's slower and needs more disk space for historical data, but it's the only mode that properly simulates stop-loss and take-profit hits that happen intrabar rather than exactly on the candle open.

Use "Open prices only" purely for rough, early-stage filtering when you're testing dozens of parameter combinations and just want to eliminate obviously broken ones.

Historical Data Quality Matters More Than You Think

MT4's built-in history is often incomplete or has gaps, especially for older dates or less liquid pairs. Before trusting any backtest:

Poor data is the single most common reason a backtest looks great in the tester and then falls apart live — not because the strategy logic is wrong, but because the historical price action being tested was never real to begin with.

Modelling Realistic Trading Costs

This is where most home-built backtests quietly lie to their owners. The default MT4 tester often assumes a flat spread and no commission, which flatters almost any EA.

To model costs properly:

Rather than guessing at numbers, check current live spreads and commissions for your actual account type using PipTax's [cost audit tool](/audit.html) and the [broker comparison pages](/brokers/index.html) — for example, comparing a standard account vs a raw-spread account on Pepperstone, or IG's own platform pricing vs its MetaTrader offering. Plug those real figures into the tester before you trust the output.

Optimisation and Walk-Forward Testing

MT4's Optimization tab lets you test many parameter combinations at once and rank them by profit, drawdown, or other criteria. It's a useful tool — and an easy way to fool yourself.

From Backtest to Live Account

Once you've run a full "Every tick" backtest with realistic costs and confirmed it survives out-of-sample testing, the next step isn't going live with full size:

1. Forward test on a demo account for several weeks to confirm live execution matches backtest behaviour. 2. Compare live costs to backtest assumptions — pull current spread and commission data via the [cost audit tool](/audit.html) and check the [rates page](/rates.html) for swap figures, since backtested numbers can go stale. 3. Start small on a live account with minimum position size before scaling up. 4. Keep monitoring — market conditions shift, and a strategy validated on 2019–2022 data may behave differently in a new volatility regime.

For a deeper grounding in testing methodology and how PipTax verifies broker cost data, see the [methodology page](/methodology.html), and browse the [school section](/school/index.html) for related tutorials on demo testing and risk sizing.

Conclusion

Learning to backtest an EA in the MT4 Strategy Tester properly — with quality data, "Every tick" modelling, honest cost inputs, and out-of-sample validation — is the difference between a useful pre-flight check and an expensive illusion. Trading remains risky regardless of how clean a backtest looks, so treat these results as one input among several, not a guarantee, and always verify your cost assumptions against live broker numbers before committing real money.

Key takeaways

  • The MT4 Strategy Tester is only as reliable as the historical data and modelling quality you feed it — always check data quality before trusting results.
  • 'Every tick' modelling gives the most realistic simulation but downloads slowly; '1 minute OHLC' is a reasonable compromise for quick checks.
  • Backtests using a fixed spread will overstate performance versus live trading, where spreads vary by broker and by session.
  • Always run a forward (out-of-sample) test and a walk-forward check before trusting an optimised parameter set.
  • Use realistic spread, commission, and swap inputs from your actual broker rather than MT4 defaults, then verify with a live cost tool.
  • A good backtest tells you a strategy's logic isn't broken — it does not guarantee future profit.
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 backtesting accurate?
It can be reasonably accurate if you use good tick data, correct modelling quality, and realistic spread/commission inputs. It's never perfect — slippage, variable spreads, and requotes in live markets can't be fully replicated. Treat results as a strong indicator, not a guarantee.
What's the difference between 'Every tick' and 'Control points' modelling?
'Every tick' rebuilds price movement from the smallest available data granularity, giving the most realistic simulation of how an EA would have reacted. 'Control points' and 'Open prices only' use far less data and run much faster, but can miss intrabar price action that would have triggered stops or entries.
Why do my backtest results look better than live trading?
Common causes are: using a fixed or unrealistically tight spread, ignoring commission and swap costs, no slippage modelling, and testing on a period that happened to suit the strategy. Always compare backtest cost assumptions against live broker data using a proper cost tool before trusting the numbers.
How much historical data do I need for a reliable EA backtest?
As a rough guide, test across at least 2-3 years and multiple market conditions (trending, ranging, high and low volatility). A short, calm period can make almost any EA look profitable.
Can I backtest with variable spread in MT4?
Standard MT4 Strategy Tester historically only supports fixed spread unless you have real tick data with spread history from your broker, or use a third-party tick data provider. Some brokers, including Pepperstone, offer downloadable tick data files with variable spread for more realistic testing.
Does a profitable backtest mean I should trade the EA live?
No. A profitable backtest only shows the logic worked on historical data under your assumptions. Before going live, run forward testing on a demo account, check costs against your actual broker via a cost tool, and start with small position sizes.

Keep going: Audit Methodology Index Index