iLowest() weird returned value

 
Print("low 0 : ",DoubleToStr(iLow(Instrument,PERIOD_H1,0),5));
Print("low 1 : ",DoubleToStr(iLow(Instrument,PERIOD_H1,1),5));      
Print("iLowest= ",IntegerToString(iLowest(Instrument,PERIOD_H1,MODE_LOW,1,0)));

result:

0 07:37:53.045 EA GBPUSD,H1: low 0 : 1.36055

0 07:37:53.045 EA GBPUSD,H1: low 1 : 1.36038

0 07:37:53.045 EA GBPUSD,H1: iLowest= 0


iLowest should be equal to 1 isn't it?


(the low 0 and low 1 are correct)


remark: 

It seems ok with more bars from the 0 one:

here with 4 bars instead of 1 (lowest of the 4 last bars instead of the last 2)

Print("low 0 : ",DoubleToStr(iLow(Instrument,PERIOD_H1,0),5));
Print("low 1 : ",DoubleToStr(iLow(Instrument,PERIOD_H1,1),5)); 
Print("low 2 : ",DoubleToStr(iLow(Instrument,PERIOD_H1,2),5)); 
Print("low 3 : ",DoubleToStr(iLow(Instrument,PERIOD_H1,3),5)); 
Print("iLowest= ",IntegerToString(iLowest(Instrument,PERIOD_H1,MODE_LOW,4,0)));

result:

0 07:55:38.061 EA GBPUSD,H1: low 0 : 1.36055

0 07:55:38.061 EA GBPUSD,H1: low 1 : 1.36038

0 07:55:38.061 EA GBPUSD,H1: low 2 : 1.36074

0 07:55:38.061 EA GBPUSD,H1: low 3 : 1.36039

0 07:55:38.061 EA GBPUSD,H1: iLowest= 1

 

You are checking iLowest starting from bar 0 for 1 bar.

It means you are calculating it only for one bar (the 0 shift).

It's obvious that returned value is always 0.


Your code should be:

Print("iLowest= ",IntegerToString(iLowest(Instrument,PERIOD_H1,MODE_LOW,2,0)));
 

Sure Fabio, 

Thanks a lot. It's obvious indeed! 

Thank you for taking me out of that fog!