Good afternoon,
I have quite a weird problem, I am trying to extract the highest and lowest of all closing prices of a given period without sucess. This is what I have so far.
However, the absolute high and low are returned, respectively. What am I doing wrong? :-)
Thats what you are asking for . . .
return( iHigh return( iLow
Thats what you are asking for . . .
My bad. Stupid mistake. Got it. Thanks!
double DCloseHighest(int shift, int period) { return(iClose(Symbol(),Period(),iHighest(Symbol(), Period(), MODE_HIGH, period+1,shift+1))); } double DCloseLowest(int shift, int period) { return(iClose(Symbol(),Period(),iLowest(Symbol(), Period(), MODE_LOW, period+1,shift+1))); }
My bad. Stupid mistake. Got it. Thanks!
![](https://c.mql5.com/mql4/forum/2013/05/yes_6.gif)
My bad. Stupid mistake. Got it. Thanks!
double DCloseHighest(int shift, int period) { return(iClose(Symbol(),Period(),iHighest(Symbol(), Period(), MODE_HIGH, period+1,shift+1))); } double DCloseLowest(int shift, int period) { return(iClose(Symbol(),Period(),iLowest(Symbol(), Period(), MODE_LOW, period+1,shift+1))); }
If you are looking for the highest/lowest close price, I believe you need to use MODE_CLOSE in your iHighest() function.
double DCloseHighest(int shift, int period) { return(iClose(Symbol(),Period(),iHighest(Symbol(), Period(), MODE_CLOSE, period+1,shift+1))); } double DCloseLowest(int shift, int period) { return(iClose(Symbol(),Period(),iLowest(Symbol(), Period(), MODE_CLOSE, period+1,shift+1))); }
If you are looking for the highest/lowest close price, I believe you need to use MODE_CLOSE in your iHighest() function.
As weird as it might be, it returns exactly the same data.
![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
Good afternoon,
I have quite a weird problem, I am trying to extract the highest and lowest of all closing prices of a given period without sucess. This is what I have so far.
However, the absolute high and low are returned, respectively. What am I doing wrong? :-)
Thanks in advance!