Most retail EAs die before they ever reach a live account. Not because the signal was wrong. Because the cost model in the backtest was fiction.
Fixed spread. Zero slippage. Every fill at the ask. That is the default in MT5, and it produces equity curves that cannot exist in the market. You are not measuring your strategy. You are measuring what your strategy would do if the market had no friction at all, which it does not.
Two numbers decide whether your EA is real once you account for costs: the spread you actually pay and the slippage you actually get. Neither of them is what MT5 assumes by default.
Why fixed spread is wrong
Brokers widen spread when they need to. News events, thin liquidity, session opens. A strategy that trades EURUSD at 0.8 pips during the London session will see 5, 10, sometimes 20 pips at a news release. That same release may be exactly when your signal fires, because news is when things move.
MT5's Strategy Tester defaults to a fixed spread, usually the current one from the server. Run a backtest mid-session on a Tuesday and you will get Tuesday's spread for every bar in the last two years. Your News EA posts excellent results. Your News EA was never tested at news spreads.
The setting you want is "Real ticks" with "Use current spread" unchecked. Under the backtest's symbol settings, pick "Based on real ticks." That uses the actual tick archive your broker supplies. Spread widens where it widened historically. You are now testing in something closer to what happened.
If your broker does not supply real tick data for the full history you need, that is itself useful information. It means any result you produce is less trustworthy than you think.
What slippage actually looks like
Slippage is not random noise around your entry. It is systematic. Orders fill worse than the last price when:
- Liquidity is thin at the moment of execution
- Your order is large relative to the quoted size
- The market is moving fast in the direction of your trade
That last one matters the most. If your EA enters on momentum, slippage is positive correlation with your fill cost. You get the worst fills precisely when the move is fast, which is precisely when you want to be in. The strategy that looks good on zero slippage may break even or worse once you model this honestly.
MT5 lets you set a slippage value in points under "Execution." The default is zero. Pick something realistic for the instrument and execution type. For a market-order scalper on EURUSD with a retail broker, 0.5 to 1.5 pips of adverse slippage is not a worst-case assumption. It is close to normal during fast markets.
You do not know your exact slippage distribution without live execution data. The honest position is to run the backtest across a range of assumptions and see where it breaks. If it breaks at 1 pip of slippage, it was never a good strategy. If it holds to 3 pips before going negative, that tells you something about the margin you have.
A strategy that survived, and one that did not
Two EAs from the same period, both trading DAX. Both posted solid equity curves on fixed spread, zero slippage.
The first was a trend-following system on the daily chart with holds measured in days, not minutes. Average winning trade was 80 points. Variable spread on DAX at news events adds maybe 2 points at worst. Slippage on a 2-lot order at a liquid session is a fraction of a point. The cost model barely moved the result. That strategy was real enough.
The second was a high-frequency scalper. Average trade: 4 points. It placed market orders during the first 30 minutes of the Frankfurt open, which is when DAX spread is at its widest and fills are least predictable. On variable spread, the average cost per round trip jumped from 0.8 points to 2.1 points. The edge was 4 points. The costs were now 2.1 points. The realistic result was about half what the backtest showed, and at 2.5 points of slippage on a fast day, it lost money.
The scalper was not a bad strategy in theory. It was a bad strategy relative to what it cost to run it. The fixed-spread backtest hid that completely.
How to stress it until it breaks
The purpose of stress testing is not to find the scenario where your EA works. It is to find the threshold where it does not, so you know exactly how much friction headroom you have before it goes negative.
Run the same backtest across a grid:
- Spread: fixed at your average, fixed at 2x average, variable (real ticks)
- Slippage: 0, 0.5, 1, 2, 3 points or pips depending on instrument
- Commission: zero, current, doubled
Nine to fifteen runs total. Look at the result table, not just the best curve. If the strategy only works in the top-left corner of the grid (tight spread, zero slippage, no commission), it is not a strategy. It is a theoretical artefact.
A strategy with a genuine edge degrades smoothly as costs rise. It does not cliff-edge at 1 pip of slippage. If yours does, you found the failure mode before the market did. That is the whole point of this exercise.
The one thing MT5 will not do for you
Variable spread in the Strategy Tester requires tick data from your broker. Brokers do not all supply this, and the ones that do may not have more than a year or two of history. Shorter history means more variance in your results and less confidence in what you found.
There are third-party tick data vendors. They cost money and the quality varies. The minimum useful check is to compare a few months of broker ticks against a vendor's ticks for the same instrument. If they disagree materially on spread during news events, you have a data quality problem, not a strategy problem. Do not let a bad data source tell you your good strategy is broken, or vice versa.
The second thing MT5 cannot model is market impact. If you are trading retail sizes, it probably does not matter. If you are scaling up, a fill that took 0.3 pips of slippage at 1 lot may take 2 pips at 10. Nothing in the backtester adjusts for this automatically. Keep it in mind as you size up.
What to do with an EA that fails the stress test
Most of them fail. That is the right answer. A strategy that survives honest cost modelling is the exception, not the baseline.
Failing the stress test does not mean the signal is worthless. It means the signal-to-cost ratio is too low at the current trade frequency or size. Options from there: reduce trade frequency (pick only the highest-conviction setups), switch to instruments with lower typical spread, or test whether longer holding times change the picture. Sometimes the same signal on the daily chart works fine when it fails badly on the 15-minute.
None of these are certain. You are looking for a version of the idea that earns more than it costs to run, which is the only version worth putting live capital on.
Where to run this
None of the techniques above require a specific broker — the Python API works against any MT5 terminal. We run our own testing on Axi, which we use because of its MT5 support, raw-spread Pro account, and the fact that it doesn't restrict DLL imports or WebRequest calls in EAs. If you're already with a broker you like, stay there.
If you do want to try Axi, our introducing-broker code is 4592551. It costs you nothing and supports the research we publish here.
Open an Axi Account →Risk notice. Trading leveraged instruments carries a high risk of loss. Nothing in this article is financial advice, and no strategy or integration described here is guaranteed to be profitable. Test everything on a demo account before risking capital.
AI Trade Lab is an Axi Introducing Broker (IB 4592551). We may receive compensation if you open an account through our links. This does not change what we publish or how we test.
