MQL5 and MetaEditor Compiler Bug may seriously mess up your code

 

I have been working on a simple EA, until I ran into some funny result.

I cannot explain it, then I realize that by commenting/uncommenting a single print line will dramatically change your result.

Definitely an alarming behavior.

If anyone has any insight regarding this behavior, please share. I would most definitely hate to have my code messed up due to a print command.



 
Coincidence. Your EA would give different results even without recompiling ?
 
Alain Verleyen:
Coincidence. Your EA would give different results even without recompiling ?

Of course not. I have to tried several times, several recompilation to boil down to the stupid Printf, and to record the video. Not sure what happened there, but definitely not normal.

 
Cong Hoa Cuong Nguyen:

Of course not. I have to tried several times, several recompilation to boil down to the stupid Printf, and to record the video. Not sure what happened there, but definitely not normal.

We have no idea about what you did or not.

Your report is useless without code to reproduce it.

 
Alain Verleyen:

We have no idea about what you did or not.

Your report is useless without code to reproduce it.

Look, I am just trying to be co-operative.

I would most definitely not want to expose my 600 line of code publicly, but if it would help by any mean, I could DM (or you, in case you are one) the developer the file.

 

did you use current spread or variable spread for the backtest?

cause your market is moving, if you use current spread the backtest result would be different

 
Pak Hong Poon:

did you use current spread or variable spread for the backtest?

cause your market is moving, if you use current spread the backtest result would be different

I just the exact tick data from July 1 to Sep 30 of 2020.

 
Cong Hoa Cuong Nguyen:

I just the exact tick data from July 1 to Sep 30 of 2020.

whether you use tick data or not is irrelevant to the spread you assign to the backtest

 
Pak Hong Poon:

did you use current spread or variable spread for the backtest?

cause your market is moving, if you use current spread the backtest result would be different

MT5 Strategy Tester is using historical spread, not any current spread.
Reason: