How do you check if a live EA still matches its backtest? - page 2

Hi Chris,

Good thread. Two things I haven't seen mentioned yet that helped me a lot.

1. Make sure the backtest itself is worth comparing against.
In MT4 a "Control points" or "Open prices" test can look completely different from live, so I only compare against Every tick tests and check the modelling quality in the report (90% is what MT4 gives with its own history). I also run the test with a spread close to my real average spread, not the fixed default, and then once more with a wider spread as a stress test. If the EA only survives with the tight spread, live will drift away from the backtest very early. In MT4 the tester also doesn't know your commission, so I add it to the spread or account for it manually – on a scalper that alone can turn a good backtest into a losing live account.

2. A switch-off line based on the EA's own statistics.
From the backtest I take the win rate and work out how long a losing streak is still normal. Roughly: with a win rate p and N trades, the longest expected losing streak is about log(N) / log(1/(1-p)). If live goes clearly beyond that – or beyond the longest losing streak in the windowed backtests – I stop and investigate, even if the drawdown is still below the backtest maximum. It reacts faster than drawdown, because drawdown depends on the lot size and on where in the cycle you started.

For the slow drift that nobody spots: I keep a rolling average of the slippage and of the time between the signal bar and the real fill over the last 20 trades. When that slowly gets worse, it's usually the VPS, the broker server or the spread at that hour – not the strategy.

Best regards.

Toyamato

Files:
Toyamato Forex #:

Hi Chris,

Good thread. Two things I haven't seen mentioned yet that helped me a lot.

1. Make sure the backtest itself is worth comparing against.
In MT4 a "Control points" or "Open prices" test can look completely different from live, so I only compare against Every tick tests and check the modelling quality in the report (90% is what MT4 gives with its own history). I also run the test with a spread close to my real average spread, not the fixed default, and then once more with a wider spread as a stress test. If the EA only survives with the tight spread, live will drift away from the backtest very early. In MT4 the tester also doesn't know your commission, so I add it to the spread or account for it manually – on a scalper that alone can turn a good backtest into a losing live account.

2. A switch-off line based on the EA's own statistics.
From the backtest I take the win rate and work out how long a losing streak is still normal. Roughly: with a win rate p and N trades, the longest expected losing streak is about log(N) / log(1/(1-p)). If live goes clearly beyond that – or beyond the longest losing streak in the windowed backtests – I stop and investigate, even if the drawdown is still below the backtest maximum. It reacts faster than drawdown, because drawdown depends on the lot size and on where in the cycle you started.

For the slow drift that nobody spots: I keep a rolling average of the slippage and of the time between the signal bar and the real fill over the last 20 trades. When that slowly gets worse, it's usually the VPS, the broker server or the spread at that hour – not the strategy.

Best regards.

Toyamato


Thanks Toyamato,

the losing streak line is the one i like most. It doesn't care about lot size or where in the cycle you started, so it should show up earlier than the drawdown.

I tried your formula on a simple case. 60% win rate and 500 trades gives about 7 losses in a row as the longest normal streak. Two things I would add. It's an average, so one or two more can still be normal. And many EAs lose in clusters, for example in one market phase, and then the real streaks are longer than the formula says. So I'd take the longest streak from the backtest windows as the line, and use the formula as a quick check when the backtest is short.

The spread stress test I'll take too. If an EA only works with the tight spread, thats something you want to know before it goes live, not after.

Chris :)
Hi Chris,

One thing that gave me a lot of fake one-sided trades: the tester doesn't start in the same state as the live EA. If the test starts on the first live day, anything with a long lookback (daily ATR, a 200 MA on H1) is built from less history, so the first signals can differ. I start the test a few weeks earlier and only compare trades from the live start date on.

Same with what the EA carries over. Live may already have open positions, a "traded today" flag or a daily loss lock, the tester starts flat. So I begin the comparison at a point where live was flat. And every terminal restart runs OnInit again and resets whatever was kept only in memory, so I put the restart times from the Journal next to the trade list. That explained most of my "only in the backtest" trades.

Rodrigo

Hi Chris,

I think comparing trades side by side is a better way to spot issues than looking at PnL alone. A few bad weeks wouldn't be too concerning, but missing trades or completely different entry times would definitely raise some questions.

I'd check the execution logs, spreads, and latency first to see where the differences are coming from. Running the EA on a stable trading fx VPS might help reduce connection-related issues too.

As for when to stop the EA, setting a maximum drawdown limit before going live seems like a sensible approach. That way, you're following a clear rule instead of reacting to every losing streak.

Christian Kotschote:
Hi everyone,

there were a few threads here lately about backtest vs live. Most ask why the two differ. I'd like to ask something a bit different: how do you notice it early enough?

What I do with my EAs is pretty simple. I run the backtest over the same weeks as the live trades, on my broker's data, and put both trade lists next to each other by entry time. Same trades with slightly worse prices is costs, thats normal. Trades that show up only on one side mean the EA live is not the EA I tested.

I also only count from the last update. A new version is basically a new EA, so the clock starts again.
Example from an EA I looked at, not one of mine. Same EA, backtest vs the seller's own live signal.



What I havent really solved for myself is the line. When is a difference still noise, and when do you switch the EA off? Drawdown above the backtest, a few weeks below it, something else?

Curious how you handle it.

Best regards
Chris
unbotheredtrader #:
I think comparing trades side by side is a better way to spot issues...

Well said. If you don't want to have to sort through the log manually for entry times, see:

Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)
Profit By Deal-Entry-In Per Hour Report for MT5 (unlike deal-entry-out in the native Tester Report)
  • 2026.08.12
  • www.mql5.com
As the MT5 Tester does not natively support reporting hourly profit and loss by deal-entry-in (only deal-entry-out), I created this MQL5 Service to to generate custom backtest reports limited to, and

Rodrigo, the start state is something I hadn't looked at that way. A daily loss lock or a "traded today" flag that only lives in memory is gone after a restart, and the tester never had it in the first place. Putting the restart times from the Journal next to the trade list is simple, i'll add that.

unbotheredtrader, i agree the max drawdown limit should be set before going live. I'd keep it as the last line though. The losing streak line can be fixed before going live too, so it's not reacting to every streak either.

I worked the numbers out a bit more since my last post. With a 60% win rate and 500 trades the average longest streak is about 7. But 9 is the point where only about 1 in 20 normal runs gets that far. So for that case 9 would be my line, and 10 in a row means I take a closer look. Drawdown still matters, it just shows up later because it depends on the lot size.

Best regards,
Chris

Hi Chris,

I do almost the same thing. I run the tester from the first live trade, on the same broker and symbol, and match the trades by entry time. On my last check 12 out of 12 trades lined up, with only small price differences. I also reset the count after every update, I agree that a new version is a new EA.

About the line, I split it into two kinds of problems because they need different answers:

1. Execution problems: the trades themselves are different
A trade on one side only, a different lot, or an SL/TP in a different place. For me even one unexplained case is enough to stop and look. Usually it's something technical: filling mode, a stops level rejection, the market being closed, or contract size on a different symbol suffix. This isn't noise, so I don't wait for more data.

2. Performance problems: same trades, the market just isn't paying
Here I don't compare against the backtest of the same weeks, but against the worst the backtest has ever done. I write down the historical max drawdown and the longest stretch without a new equity high. Live is still "normal" while it stays inside those two numbers. I would switch off if live drawdown goes clearly past the historical max (for me around 1.2–1.5x), or the flat period lasts much longer than anything in the history.

A few weeks below the backtest says very little for a swing system. Some months there are only a handful of trades, so one missed TP changes the picture. That's why I would rather look at whether the same trades happen than whether the profit matches.

One extra thing: I check swap and commission separately. On gold, holding long for several days can change the result a lot even when the entries are identical, and the tester doesn't always use the same swap the broker charges today.

Best regards,
Henry

Thanks @Henry Djuhanda ,

the split into execution and performance makes a lot of sense to me. With execution there is no normal range, one trade that is different needs an explanation. With performance you need a range first, and that's the harder part.

The longest stretch without a new equity high is a good one, i hadn't used that as a line yet. Its the same problem as with the drawdown though. The backtest only gives you one history, so its worst drawdown and its longest flat period are just one draw each. A live run can go past them without anything being broken. I guess that's why your 1.2–1.5x buffer works better than the exact number.

Did you pick the 1.2–1.5x from experience, or did you test it somehow, for example with a Monte Carlo on the backtest trades?

Best regards
Chris

On Christian’s point that one backtest gives you only one drawdown: cutting the history into windows with the same number of trades as the live sample gives you a distribution instead of a single figure.

For each window I record two things, the longest losing streak and the deepest drawdown in R, and fix the switch-off line at the worst 5% of each before going live.

Pairing them matters, because nine losses at 0.5R and nine at full size aren’t the same signal, and an EA that starts losing bigger rather than more often won’t trip a streak counter.Reshuffling the trade order, Monte Carlo style, widens the range further, although it assumes trades are independent and clustered losses aren’t. Execution differences, as Henry says, shouldn’t wait for any threshold.


Eduardo

Eduardo Cumplido #:

On Christian’s point that one backtest gives you only one drawdown: cutting the history into windows with the same number of trades as the live sample gives you a distribution instead of a single figure.

For each window I record two things, the longest losing streak and the deepest drawdown in R, and fix the switch-off line at the worst 5% of each before going live.

Pairing them matters, because nine losses at 0.5R and nine at full size aren’t the same signal, and an EA that starts losing bigger rather than more often won’t trip a streak counter.Reshuffling the trade order, Monte Carlo style, widens the range further, although it assumes trades are independent and clustered losses aren’t. Execution differences, as Henry says, shouldn’t wait for any threshold.


Eduardo

Hi Eduardo,

I like the windows with the same number of trades as the live sample. That gets around the "one draw" problem without assuming independent trades, like the reshuffle does.

Losing bigger instead of more often i didnt have on my list. A streak counter stays quiet there, so the streak needs the size next to it, like you do with R.

How long does the backtest need to be for this? With 100 live trades and 1,000 backtest trades i'd only get 10 windows that don't overlap, and the worst 5% of 10 is basically the worst one again. Do you let the windows overlap?

Best regards,
Chris