Does MQL4 handle out of range differently?

 
Are there principally differences between the way mql4 and mql5 handle out of range?

Or are there big principal differences in how the iHighest function of mql4 handles for example negative count values? Because iHighest of mql5 won't take those.
 

Yes. MT5 and MT4 with strict terminates the code. MT4 without just reads zero.

Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.

 
Tobias Johannes Zimmer:
Are there principally differences between the way mql4 and mql5 handle out of range?

Or are there big principal differences in how the iHighest function of mql4 handles for example negative count values? Because iHighest of mql5 won't take those.
Are you using "#property strict" ?

This is important for MQL4.
 
Dominik Egert #:
Are you using "#property strict" ?

This is important for MQL4.
I am translating an mql4 Indicator but it seems pretty old and doesn't use strict. I was figuring that it could have something to do with property strict... Thanks Dominik.

You are probably right:
"Please pay special attention to "Array out of range" error - many old custom indicators will display this error in strict mode of the new compiler when launched on the chart. It is recommended to find the cause and eliminate it."

https://docs.mql4.com/basis/mql4changes#compiler_difference
 
William Roeder #:

Yes. MT5 and MT4 with strict terminates the code. MT4 without just reads zero.

Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.

Oh hello William, thanks a lot for the tip. I just overread it.