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, the process is straightforward mechanically but easy to get wrong in ways that quietly wreck your results. This guide walks through the real workflow — from sourcing decent data to reading the report without fooling yourself — so you finish with something you can actually act on.

What the MT4 Strategy Tester Actually Does

The Strategy Tester replays historical price data through your EA's code, bar by bar or tick by tick, and logs every simulated trade it would have taken. It then produces a report with metrics like net profit, drawdown, profit factor and a trade list.

What it does not do automatically:

It's a simulation tool built on assumptions you control. Get the assumptions wrong and the output is fiction dressed up as a report. Get them right and you have a genuinely useful filter for deciding whether an EA deserves further attention.

Step 1: Sort Out Your Historical Data First

Before you even open the Strategy Tester, check your data quality in the History Centre (Tools > History Centre in MT4). Look for:

Most brokers' default MT4 data feed is thin, especially for tick data going back years. If you're testing on a Pepperstone or IG MT4 server, download history directly from their server rather than relying on whatever ships with a generic terminal install — it's more likely to match the conditions you'd actually trade under. Third-party tick data providers exist too, but treat any source with a grain of salt until you've spot-checked it against known price action (a major news event is a good sanity check).

Step 2: Set Up the Test Correctly

Open Strategy Tester (Ctrl+R), select your EA, symbol and date range, then configure:

1. Model: choose "Every tick" for anything meaningful. "Open prices only" is fine for a rough first pass but too crude to trust. 2. Spread: don't leave this on "Current" or a random fixed value. Set it to something close to what you'd realistically pay — check live spreads for your actual broker and account type using PipTax's [cost audit tool](/audit.html) rather than guessing. 3. Optimisation: leave this off for your first run. You want to see how the EA performs with its stated default settings, not a version reverse-engineered to fit the past. 4. Initial deposit and lot sizing: match this to a realistic account size, not an arbitrary round number that changes risk-per-trade beyond what you'd actually run.

Run the test and let it complete — don't judge partial results.

Step 3: Read the Report Without Fooling Yourself

The report tab gives you numbers; the graph tab gives you shape. Both matter.

Key things to check, not just net profit:

| Metric | Why it matters | |---|---| | Total trades | Under ~100 trades, conclusions are statistically weak | | Max drawdown | Tells you the worst equity dip you'd have had to sit through | | Profit factor | Gross profit ÷ gross loss — above 1.0 means profitable in test, but treat anything under ~1.3 as fragile | | Consecutive losses | Shows the emotional stress test, not just the maths | | Recovery factor | Net profit ÷ max drawdown — a rough gauge of how efficiently profit was earned relative to pain |

A smooth, steadily rising equity curve is a good sign. A curve with one or two huge spikes carrying the whole result is a red flag — it usually means the strategy's real edge is thin or the result depends on a handful of lucky trades.

Step 4: Stress-Test Across Different Conditions

A single date range tells you how an EA did in one slice of market history. Before trusting anything, re-run the test across:

If performance collapses outside the original window, the strategy may be curve-fitted to that specific slice of history rather than genuinely robust. This is one of the most common ways backtests mislead people, and it's also the fastest way to spot an EA that's been over-optimised by its seller to look good on a sales page.

Step 5: Account for Real Trading Costs

This is where most backtests quietly overstate performance. The default spread in Strategy Tester rarely matches what you'd pay live, and swaps/commissions are often ignored entirely.

Before deciding an EA is worth demo-testing:

An EA that's marginally profitable on paper can turn negative once realistic spreads and commissions are applied. This step alone filters out a lot of strategies before you waste time forward testing them.

Moving From Backtest to Forward Test

A clean backtest earns an EA a place on demo, not a live account. Run it on a demo account for a meaningful stretch — several weeks minimum, covering different market conditions — and compare live-simulated results against the original backtest. Divergence is normal; large divergence is a warning sign about data quality, slippage assumptions, or broker-specific execution quirks.

If you're new to this whole process, PipTax's [trading school](/school/index.html) has broader material on strategy evaluation and risk management worth working through alongside this. And for the methodology behind how we think about cost and testing rigour generally, see our [methodology page](/methodology.html).

Conclusion

Learning to backtest an EA in the MT4 Strategy Tester properly is less about clicking the right buttons and more about being sceptical of your own results — checking data quality, using realistic costs, and stress-testing across conditions before you let a good-looking equity curve talk you into risking real money. Treat every backtest as a first filter, confirm it on demo, and always price in your actual broker's spreads and commissions before drawing conclusions. Trading forex carries real risk of loss, and no backtest, however clean, removes that.

Key takeaways

  • The MT4 Strategy Tester is only as reliable as the historical price data feeding it, so check data quality before trusting any result
  • Modelling quality matters: use 'Every tick' with a good data source rather than 'Open prices only' for anything resembling a real result
  • Always test with realistic spread and slippage assumptions, not the default fixed spread, because live costs change your edge
  • A backtest report full of green numbers means nothing if the trade count is too low or the period doesn't cover different market conditions
  • Forward test on a demo account before going live, because backtests cannot fully replicate real execution, requotes or broker-specific conditions
  • Use PipTax's cost tool to see how real spreads and commissions from your broker would have eaten into the backtested 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 before going live?
It's a useful first filter, not a guarantee. MT4's Strategy Tester can only simulate historical price movement and does not fully capture live spread changes, slippage, requotes or broker-specific execution. Treat a good backtest as permission to move to demo forward testing, not as proof the EA will work live.
What's the difference between 'Every tick' and 'Open prices only' modelling?
'Open prices only' only evaluates the EA once per bar using the opening price, which is fast but crude and can badly misrepresent strategies that react within a bar. 'Every tick' reconstructs sub-minute price movement from your historical data and gives a far more realistic simulation, though it takes longer to run.
Why does my backtest look profitable but the EA loses money live?
Common causes are poor-quality historical data, unrealistic fixed spread settings, ignoring slippage, over-optimising parameters to fit the past (curve-fitting), and testing over too short or too calm a period. Real spreads, swaps and commissions from your actual broker also change the maths — check these on PipTax's cost tool.
How much historical data do I need to backtest an EA properly?
Aim to cover several years and a mix of market conditions — trending, ranging, and at least one high-volatility period like a major news shock. A strategy that only works in one type of market is fragile. Also make sure you have enough trades in the report (generally 100+) to draw any meaningful conclusion.
Can I backtest an EA using my live broker's MT4 server?
Yes, and it's a good idea because the data provided will reflect that broker's own price history and symbol specifications. Pepperstone and IG both let MT4 users download history via their own servers, which is more representative than generic third-party data of unknown origin.

Keep going: Audit Index Methodology Index