bug in iHighest / iLowest

 

Hi guys,

this code returns different results every time you change the timeframe.

  double smintest = High[iHighest(NULL,PERIOD_M5,MODE_HIGH,4,1)];

  double smaxtest = Low[iLowest(NULL,PERIOD_M5,MODE_LOW,4,1)]; 

The period is static. Therefore it should give the same result on every timeframe!

Any idea how to solve this problem?

thanks in advance,

Daniel

Files:
 

Of course it does, you are using High[] which will return the high for the shift on the current timeframe

If you want the high from the M5 timeframe, then you should be using iHigh

 

Thanks GumRai,

i got my error.

cheers

 
blueball:

Thanks GumRai,

i got my error.

cheers


Well done :)
Reason: