Hi guys!
I am trying to implement a simple range breakout system and have problems with getting the high and the low of the 2 o'clock to 10 o'clock range.
function Range(){
if(lhour(CET) >= 2 && lhour(CET) <= 10){
vars Highs = series(priceHigh());
vars Lows = series(priceLow());
int i;
int j;
for(i=0;i<sizeof(Highs);i++){
if(Highs[i] > Highs[i+1])
return Highs[i];
else
return Highs[i+1];
}
for(j=0;j<sizeof(Lows);j++){
if(Lows[j] < Lows[j+1])
return Lows[j];
else
return Lows[j+1];
}
}
}
Is there an easier way to get the max/min of a series?
And when I call the Range function I get the Error 41 because the series depends on the if condition. How can I get only the 2-10 range?
Thanks in advance for any help!