Invalid MQL4 functions in MQL5

 

I have noticed that in the MQL5 code editor, you have the MQL4 functions iTime, iClose, iHigh etc. They are marked as system functions, their inputs pop up when you type them and they are accepted by the compiler. But they don't work.

According to the documentation none of those things are supposed to exist in MQL5, but still they are there. Which for example means that it's not possible to create your own iClose function with the same inputs.

Does anybody here know why they are there at all?

See picture

Files:
mql5.png  96 kb
 
copyright 2016 ??
 

add the #property strict on the top,

then u will know what's should to change.

 

It's the EA template from the very latest MT5 version. I guess 2016 was pre-filled from when I first installed MT5 or something.

I added #property strict

It still goes through the compiler without a glitch.

 
forextime8:

add the #property strict on the top,

then u will know what's should to change.

#property strict is not used with mql5.
 
MrMetatrader:

I have noticed that in the MQL5 code editor, you have the MQL4 functions iTime, iClose, iHigh etc. They are marked as system functions, their inputs pop up when you type them and they are accepted by the compiler. But they don't work.

According to the documentation none of those things are supposed to exist in MQL5, but still they are there. Which for example means that it's not possible to create your own iClose function with the same inputs.

Does anybody here know why they are there at all?

See picture

Because you are a betatester without knowing it.

Last release build is 1816, you have a greater version.

 
Alain Verleyen:

Because you are a betatester without knowing it.

Last release build is 1816, you have a greater version.

Interesting. Yes I have build 1835 released June 01. I raised a ticket at the Service Desk and their reply was simply: "Because MT4 and MT5 use the same compiler." Sounds like a pretty bad solution though, that in the code editor you get popups for suggested functions for functions that can't be used. And still impossible to create functions with that name.

Are you saying that this is only the case in beta versions?

 
MrMetatrader:

Interesting. Yes I have build 1835 released June 01. I raised a ticket at the Service Desk and their reply was simply: "Because MT4 and MT5 use the same compiler." Sounds like a pretty bad solution though, that in the code editor you get popups for suggested functions for functions that can't be used. And still impossible to create functions with that name.

Are you saying that this is only the case in beta versions?

At least it's not the case on build 1816.
 

We now get the answer.

MQL5: New functions: iTime, iOpen, iHigh, iLow, iClose, iVolume, iBars, iBarShift, iLowest, iHighest, iRealVolume, iTickVolume, iSpread. These functions are similar to those used in MQL4. These functions help users to easier transfer code of trading applications to the fifth generation platform.

Earlier, most of tasks performed through these functions could be implemented using Copy* functions. However, users had to implement their own functions in order to find the High/Low values ​​on the chart and to search for bars based on their time. Now, these tasks can be easily executed using iHighest, iLowest and iBarShift functions.

Reason: