First I appologize if this question has been answered thouroughly somewhere else in the forum, but I have read anything I could found on that and still lost.
If somone could just tell me how to write in MQL5:
(in MQL4 )
If High>High then ...
the formula for finding the highest value in the last 30 bars:
(in MQL4) -
I reached a certain level of proficieny in MQL4 after 2 years of non-intensive coding, but now I must admit I am lost again, if anyone could help I would be grateful.
Check out the timeseries porting library at https://www.mql5.com/en/forum/121011/page14
Thank you for your response.
What I am looking for is not workarounds but how the code should be done in MQL5, unless this is the only way to proceed ?
I mean how can I proceed to have If High>High then using the MQL5 way, as if MQL4 never existed ?
Many thanks and regards,
It's not really a workaround - the code that's in the timeseries file I posted gives a strong pointer to the way that you must code it in MQL5, although you don't need a function call each time.
Here's the relevant function
double iHigh(string symbol,int tf,int index)
if(index < 0) return(-1);
if(CopyHigh(symbol,timeframe, index, 1, Arr)>0) return(Arr);
In your case you can take advantage of pulling both values at once
Print("error getting high values");
// High and High because CopyHigh starts at shift=1