Big Lesson on MQL5
hematinik:
I was converting my own indicator from MQL4 to MQL5 and while I'm pretty good at both standards, the result in MQL5 was wildly different. the culprit was some uninitialized local variables inside loops, that which worked well under MQL4 but crazy under MQL5.
Always explicitly initialize local variables or else MQL will surprise you again.
if i am not mistaken, the ide does give you a warning of this when you compile it.
Big lession: Always assign the value to the variable before using it
I was converting my own indicator from MQL4 to MQL5 and while I'm pretty good at both standards, the result in MQL5 was wildly different. the culprit was some uninitialized local variables inside loops, that which worked well under MQL4 but crazy under MQL5.
Always explicitly initialize local variables or else MQL will surprise you again.