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.
- Where is CopyBuffer in MQL4 ??
- MQL5 WindowHandle() error message -> (function not defined)
- Upgrading from mql4 to mql5, or using mql5 libraries in MetaTrader 4
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?
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.
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 #:
Oh hello William, thanks a lot for the tip. I just overread it.
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.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register