Dear All,
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 )
and
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
Paul
- www.mql5.com
Check out the timeseries porting library at https://www.mql5.com/en/forum/121011/page14
Paul
http://paulsfxrandomwalk.blogspot.com/
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[1]>High[2] then using the MQL5 way, as if MQL4 never existed ?
Many thanks and regards,
inquisiteur
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[1]>High[2] then using the MQL5 way, as if MQL4 never existed ?
Many thanks and regards,
inquisiteur
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); double Arr[]; ENUM_TIMEFRAMES timeframe=TFMigrate(tf); if(CopyHigh(symbol,timeframe, index, 1, Arr)>0) return(Arr[0]); else return(-1); }
In your case you can take advantage of pulling both values at once
double High[]; if(CopyHigh(_Symbol,_Period,1,2,High)<2) { Print("error getting high values"); } // High[0] and High[1] because CopyHigh starts at shift=1 if(High[0]>High[1]) { // }
Paul
- 2012.06.14
- Paul
- paulsfxrandomwalk.blogspot.com
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
In your case you can take advantage of pulling both values at once
Paul
/go?link=http://paulsfxrandomwalk.blogspot.com/
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear All,
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 )
and
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.