MT5 works differently! Is this an indicator or an EA?
Depending on the circumstances, there can be many different solutions. Show more code or explain in more detail.
One solution is to use the "i" functions instead but it depends, for example iOpen( _Symbol, _Period, i )
For more information, read the following:
- www.mql5.com
MT5 works differently! Is this an indicator or an EA?
Depending on the circumstances, there can be many different solutions. Show more code or explain in more detail.
One solution is to use the "i" functions instead but it depends, for example iOpen( _Symbol, _Period, i )
For more information, read the following:
This is for an indicator.
This expression is when the open of the previous candle is above of its middle
For an Indicator, using the OnCalculate() event handler, you can use the data arrays passed as parameters.
open[ i + 1 ] > ( high[ i + 1 ] + low[ i + 1 ] ) / 2
However, even in MQL4+, this was the correct way to do it. The main difference between the MQL4+ and MQL5 OnCalculate handling is that the array sequencing is reversed, because MQL4+ uses Arrays as a Series and MQL5 uses them as a Non-Series.
Please read up on the links I provided. There are also many other references on the Forum, the CodeBase and the Articles, about converting to MQL5.
For an Indicator, using the OnCalculate() event handler, you can use the data arrays passed as parameters.
However, even in MQL4+, this was the correct way to do it. The main difference between the MQL4+ and MQL5 OnCalculate handling is that the array sequencing is reversed, because MQL4+ uses Arrays as a Series and MQL5 uses them as a Non-Series.
Please read up on the links I provided. There are also many other references on the Forum, the CodeBase and the Articles, about converting to MQL5.
Ok, thanks very much
If you want an example of an indicator that compiles for both MQL4 and MQL5, so you can study it and see the differences, then have a look at my CodeBase publication:
- www.mql5.com
Hello everyone. I would appreciate it if you could help me. My question is How is it possible to determine the mathematical function or mathematical formula of a custom indicator??? I mean like the mathematical formula that is available on the internet for Average True Range indicator.
Thank you so much
By analysing its code!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How do you put this MQL4 expression in MQL5 language ?
Open[1+i] > (High[1+i] + Low[1+i]) / 2
I tried MathAbs(Open[1+i]>(High[1+i]+Low[1+i])/2) but it gives error and cannot compile
Thanks for your inputs.