Different Backtesting Results on different MT5 Programs

 

Hello guys,

I have two different MT5 Platforms: one is for my real money account and is a version of MT5 supplied by my broker. The other one is just regular MT5 for playing around with a demo account.

I have backtested one of my EAs with the exact same inputs on both these platforms and I get significantly different results for the exact same test. It seems that it just takes trades differently or sometimes not at all on the MT5 platform of my broker.

Does anybody know why this happens? I am very insecure about which results to trust in terms of what will actually happen when I migrate my EA onto an MT5 VPS via my broker's MT5 platform.

Thanks for your help in advance.

Eric

Edit: I have attached two graphs to show the difference.

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Account Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Files:
 
ERIC DANIEL BRAENDLI:

I have two different MT5 Platforms: one is for my real money account and is a version of MT5 supplied by my broker. The other one is just regular MT5 for playing around with a demo account.

I have backtested one of my EAs with the exact same inputs on both these platforms and I get significantly different results for the exact same test. It seems that it just takes trades differently or sometimes not at all on the MT5 platform of my broker.

Does anybody know why this happens? I am very insecure about which results to trust in terms of what will actually happen when I migrate my EA onto an MT5 VPS via my broker's MT5 platform.

That is to be expected as the data feed for the historical data and tick data will be different between the two.

On one your data comes from your broker and the other the data comes from MetaQuotes.

Given that every broker's data is slightly different, the fact that your EA cannot adjust to those differences, means that it is flawed or that you are over-fitting your optimisations.

You have every reason to be "insecure" about your EA. You should use a strategy that can adjust to the those differences and make sure your code is working properly too.

EDIT: You should also test against the real ticks and generated ticks and look at the differences, as an added step to test the robustness of your EA. Also introduce delays and slippage and different spread values as well. All this to make sure your EA can handle the variations to your satisfaction.
 
Fernando Carreiro #:

That is to be expected as the data feed for the historical data and tick data will be different between the two.

On one your data comes from your broker and the other the data comes from MetaQuotes.

Given that every broker's data is slightly different, the fact that your EA cannot adjust to those differences, means that it is flawed or that you are over-fitting your optimisations.

You have every reason to be "insecure" about your EA. You should use a strategy that can adjust to the those differences and make sure your code is working properly too.

EDIT: You should also test against the real ticks and generated ticks and look at the differences, as an added step to test the robustness of your EA. Also introduce delays and slippage and different spread values as well. All this to make sure your EA can handle the variations to your satisfaction.

Hello, thanks for your reply.

I know that slippages and market data are different between different brokers. What confuses me (I should have explained that before) is that my EA takes trades that stay open for multiple days or even weeks. I always assumed that slight data differences, slippage and variable spread have much more of an impact in short term trading. I was assuming that it shouldn't play much of a role in my case. Also: can I rely on the simulations that I did with my brokers data to (more or less) accurately represent what would have actually happened? In that case I wouldn't mind the results being different from demo MT5.

Thank you very much for your help!

Eric

PS: How do I simulate real ticks and generated ticks?

 
ERIC DANIEL BRAENDLI #: I know that slippages and market data are different between different brokers. What confuses me (I should have explained that before) is that my EA takes trades that stay open for multiple days or even weeks. I always assumed that slight data differences, slippage and variable spread have much more of an impact in short term trading. I was assuming that it shouldn't play much of a role in my case. Also: can I rely on the simulations that I did with my brokers data to (more or less) accurately represent what would have actually happened? In that case I wouldn't mind the results being different from demo MT5.

PS: How do I simulate real ticks and generated ticks?

Only you can answer the main questions. I would look at the trade results of the two tests, looking for the major differences in trades and analyse why they were opened or closed so differently. Was it a major difference in the data? Was it a flaw in the EA code? Was it due to the strategy rules?

You have to ask all these questions (and more) and analyse them. Just because you use an EA does not mean that you can sit back and relax on the beach with a cocktail in your hand. Using EAs is just as much hard work as trading manually, but just needs a different set of skills.

As for the generated versus real ticks, you set it in the Settings of the Strategy Tester:


 
Fernando Carreiro #:

Only you can answer the main questions. I would look at the trade results of the two tests, looking for the major differences in trades and analyse why they were opened or closed so differently. Was it a major difference in the data? Was it a flaw in the EA code? Was it due to the strategy rules?

You have to ask all these questions (and more) and analyse them. Just because you use an EA does not mean that you can sit back and relax on the beach with a cocktail in your hand. Using EAs is just as much hard work as trading manually, but just needs a different set of skills.

As for the generated versus real ticks, you set it in the Settings of the Strategy Tester:


Thanks for your help! I have now also noticed some discrepancies when testing with these different settings, but not much. I'll try to figure it out.

Reason: