Download MetaTrader 5

bug in iHighest / iLowest

To add comments, please log in or register
Daniel Stein
31013
Daniel Stein  

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:
Keith Watford
Moderator
10566
Keith Watford  

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

Daniel Stein
31013
Daniel Stein  

Thanks GumRai,

i got my error.

cheers

Keith Watford
Moderator
10566
Keith Watford  
blueball:

Thanks GumRai,

i got my error.

cheers


Well done :)
To add comments, please log in or register