Mismatched Results Between Live Trading and Demo Trading in Expert Advisor (EA)

 

When I backtest my Expert Advisor (EA) on a live account, the results differ significantly from those on the demo account. I suspect this discrepancy is caused by the spread difference — the live account has a 0.2 spread.

I’m not entirely sure how to handle or adjust for this spread variation within the EA code. If anyone has experience managing spread-related discrepancies between live and demo environments, your guidance would be greatly appreciated.

 
Shubham DahiphaleWhen I backtest my Expert Advisor (EA) on a live account, the results differ significantly from those on the demo account. I suspect this discrepancy is caused by the spread difference — the live account has a 0.2 spread. I’m not entirely sure how to handle or adjust for this spread variation within the EA code. If anyone has experience managing spread-related discrepancies between live and demo environments, your guidance would be greatly appreciated.

What do you mean by "how to handle or adjust for this spread variation within the EA code"?

If the two accounts present different spread, then obviously the results will be different. 

There is a Ask price and a Bid price (the spread being the difference). Charts only shows the bars/candles based on Bid (or Last) prices.

  • A "buy" position opens at the Ask price and closes at the Bid price.
  • A "sell" position opens at the Bid price and closes at the Ask price.

Enable the Ask price line on your chart so that you can track the current value visually.

Run your back-tests using "Every-tick based on real ticks", and make sure that the testing period is within the period that real tick data is available.

 
Fernando Carreiro #:

What do you mean by "how to handle or adjust for this spread variation within the EA code"?

If the two accounts present different spread, then obviously the results will be different. 

There is a Ask price and a Bid price (the spread being the difference). Charts only shows the bars/candles based on Bid (or Last) prices.

  • A "buy" position opens at the Ask price and closes at the Bid price.
  • A "sell" position opens at the Bid price and closes at the Ask price.

Enable the Ask price line on your chart so that you can track the current value visually.

Run your back-tests using "Every-tick based on real ticks", and make sure that the testing period is within the period that real tick data is available.

I tested my EA on an MT5 demo account using the XAUUSD symbol with a 0.01 lot size in August 2025. It performed well, turning a $500 deposit into around $630 profit.

However, when I ran the same EA with identical parameters on my live Exness account (symbol: XAUUSDm), it quickly blew the account. I’m not sure why this is happening — I’ve searched online but couldn’t find clear information.

Any insights on why the EA behaves so differently between demo and live accounts would be greatly appreciated.

 
Shubham Dahiphale #:

I tested my EA on an MT5 demo account using the XAUUSD symbol with a 0.01 lot size in August 2025. It performed well, turning a $500 deposit into around $630 profit.

However, when I ran the same EA with identical parameters on my live Exness account (symbol: XAUUSDm), it quickly blew the account. I’m not sure why this is happening — I’ve searched online but couldn’t find clear information.

Any insights on why the EA behaves so differently between demo and live accounts would be greatly appreciated.

There are many reasons, too many to discuss in a single thread, but summary follows...

every broker is different and each user can receive different ticks and number of ticks to another user, even if they are using same broker server; this means that 2 users on same broker can have very different results; 1 can make millions while the 2nd user will blow up their account.

As for that broker, they have been discussed on many threads on this site over the years, with so many issues with them; i do not know how they are still in operation.

I think that they also use different ticks to their live server, so their ticks on demo are different to the ticks on the live server, so this could be main reason for your issue, however, there are many other possible. This issue is rarely responded to anymore without a comment from a moderator to the commentor to do their own research; as i said, this issue is very common: even among the more reputable brokers.

 
Michael Charles Schefe #:

There are many reasons, too many to discuss in a single thread, but summary follows...

every broker is different and each user can receive different ticks and number of ticks to another user, even if they are using same broker server; this means that 2 users on same broker can have very different results; 1 can make millions while the 2nd user will blow up their account.

As for that broker, they have been discussed on many threads on this site over the years, with so many issues with them; i do not know how they are still in operation.

I think that they also use different ticks to their live server, so their ticks on demo are different to the ticks on the live server, so this could be main reason for your issue, however, there are many other possible. This issue is rarely responded to anymore without a comment from a moderator to the commentor to do their own research; as i said, this issue is very common: even among the more reputable brokers.

Thanks for the reply 
 
If the EA is sensitive to ticks (minute timeframe !?) then you should only be backtesting with "based on real ticks", otherwise the backtest will be run on artificial spread and volatility, and the difference in results is extreme between real volatility and fake. I think there was a way to simulate different spreads in MT4, I don't know about MT5, but it's pointless anyway because you have to deal with the real broker spread.