ForexCopilotEA

Backtesting

Why Your Expert Advisor's Live Results Differ From the Backtest: Eleven Causes and How to Check Each

By Benjamin Lee · Updated · 6 min read

The backtest looked excellent. The live account is flat or losing. Almost every EA trader meets this gap, and it feels like being cheated, whether by the seller, the broker or the tester. Sometimes one of them is at fault, but more often the cause is ordinary: costs the test did not charge, fills the tester could not model, or settings that were fitted to the past. This guide lists eleven causes of the gap, shows how to check each, and gives a process to find out which one is yours and what to do about it.

Key takeaways

  • A gap between backtest and live is normal. A big, persistent gap has a cause you can find.
  • Start with costs: spread, commission, swap and slippage are the most common culprits.
  • Check that live trades match what the backtest would have taken on the same days.
  • Overfitting is the hardest cause to see. Test on unseen data and forward test on demo.
  • Fix one cause at a time and measure the change.

Expect some gap

A backtest is a model. It replays past prices with assumptions about costs and execution. The live market adds friction that the model approximates. Even a perfect EA would show a little less profit live than in a clean test. The question is how big the gap is and whether it is stable. A small steady gap is cost. A large or growing one points to a specific cause. Our guide on how backtests can mislead covers cases where the test itself was built to flatter.

Eleven causes, in the order to check

Causes of the backtest-to-live gap
#CauseHow it shows upHow to check
1Spread wider than testedMany small trades lose more than the testCompare live spread at entry with the test's spread
2Commission and swapA steady drag on every tradeAdd them to the tester; check swap on held trades
3Slippage and delayFills worse than the requested price, especially in newsCompare entry prices with the signal price; test with delay
4Different dataTrades appear or vanish versus the testBacktest on your broker's real ticks
5Wrong settings or setfileDifferent lot, stops or filtersCompare live inputs with the tested ones
6Different timeframe or symbolStrategy behaves differentlyMatch the manual
7Account typeHedging, netting, leverage or execution differTest on the same account type
8Server time differenceSession filters shift by hoursCheck the time inputs against server time
9Missing news filter in the testThe tester traded through news the live filter avoidsCompare with a time-based pause
10OverfittingTest is great, live is poor from the startTest unseen periods; walk-forward
11A regime changeWorked for years, fails recentlyTest the most recent months separately

Causes 1 to 3: costs and fills

These explain most gaps for short-term EAs. Take a scalper with a 4 pip average target on EURUSD. If the test used a 0.2 pip spread and no commission, and the live account has a 1.2 pip spread, one full pip of the 4 is gone on every trade. That is a quarter of the gross edge. Slippage adds more. A strategy that depends on tiny margins can turn from profitable to unprofitable with that change alone. The account types guide shows a worked example, and spread, slippage and swap explains each cost.

  • Record the spread and the fill price of each live trade for a few weeks, and compare with the test.
  • Use real ticks in the tester, with a realistic delay, as in the tester settings guide.
  • Add commission and, for held trades, the swap values from the symbol specification.

Causes 4 to 9: setup differences

These are mistakes or mismatches rather than market effects. Pull up the live trades for a week and run the backtest for the same dates on your broker's data. Place both lists side by side. If the backtest takes trades the live EA did not, or the reverse, look at what differs: the time filter, a news filter, a spread cap, the symbol, the lot, the account mode. The trade list is the best diagnostic you have. Comparing it takes an hour and often finds the cause.

  1. Step 1: Export live trades for a recent week

    Use the History tab. Note times, symbols, directions, sizes and prices.

  2. Step 2: Run the backtest for the same week

    Same EA, same inputs, real ticks, your costs and delay. Save the trade list.

  3. Step 3: Match trade by trade

    Find trades present in one list and missing in the other.

  4. Step 4: Explain each difference

    Time zone, spread filter, news filter, rejected order, different input or data.

  5. Step 5: Fix the largest difference first

    Then repeat for another week to see if the fix holds.

Causes 10 and 11: the hard ones

If the live results are poor from the first weeks and trade-by-trade matching finds nothing, the settings may have been tuned to the past. Optimisation picks what fit best, including luck. Check this by testing a period the settings were not tuned on, and by running a walk-forward analysis, as in our walk-forward guide and the overfitting guide.

A regime change is different: the EA worked for years and then stopped. Markets move between trending, ranging, calm and wild phases. A trend EA suffers in long ranges, a mean-reversion EA in strong trends. Test the last few months on their own. If the EA loses in the tester over the same months, the market has changed, not the EA's execution. Then decide whether to pause, reduce size or wait, with the rules in what to do when your EA is in drawdown.

Closing the gap

What to do depending on what you find
FindingAction
Costs larger than the testRerun the test with true costs. Change account type or broker if the edge disappears
Slippage on newsAdd a news pause, cut size around events
Setup mismatchCorrect the inputs, time zone or symbol, and retest
Data differenceTest on your broker's real ticks; compare with another source
OverfittingReduce optimised inputs, choose stable settings, forward test; consider a different EA
Regime changeReduce size, pause or wait; do not re-optimise on the latest weeks
Backtest-versus-live checklist
0/8

If the EA was bought on the strength of a backtest alone, our buying checklist and the guide on verifying a track record describe the evidence to ask for. The full routine is in the MT5 Expert Advisors guide.

Sources and further reading

  1. MetaTrader 5 Help: Strategy TestingThe Strategy Tester: testing modes, settings and forward testing.
  2. MetaTrader 5 Help: Real and Generated TicksThe difference between ticks recorded from the broker and ticks the tester generates.
  3. MetaTrader 5 Help: Testing ReportWhat each figure in the tester's report means, including drawdown.
  4. Bailey, Borwein, López de Prado and Zhu: Pseudo-Mathematics and Financial Charlatanism (Notices of the AMS, May 2014)A plain-language account of how backtest overfitting produces strategies that fail out of sample.

Frequently asked questions

Why is my EA losing live when the backtest was profitable?

Common causes are higher live spread and slippage than tested, commission and swap, setup mismatches, different data and overfitting. Compare live trades with a backtest of the same week to find the difference.

How big a gap between backtest and live is normal?

Some gap is normal because of costs and execution. A small, steady gap is expected. A large or growing gap has a specific cause that you can find.

Is the seller lying if live results differ from the backtest?

Not necessarily. Costs, execution and market changes explain most gaps. If the seller's test used unrealistic spreads or hid drawdown, that is a problem, so ask for details.

How do I test whether my EA is overfitted?

Run it on a period the settings were not tuned on, use walk-forward analysis, and forward test on demo. If results collapse out-of-sample, it was probably fitted to the past.

Should I re-optimise after poor live results?

Be careful. Optimising on the latest weeks usually fits noise. Diagnose the cause first, and if you do re-optimise, test on unseen data and demo before going live.

Expert Advisors in these styles

Apply the checks above to any of these before you buy: read the manual, run your own backtest, and start on demo.

Browse Expert Advisors