Download MetaTrader 5
To add comments, please log in or register
Need mobile version of MetaTrader 5? Download it and trade!
Daniel Stein
19822
Daniel Stein 2014.03.24 10:15 

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
8026
Keith Watford 2014.03.24 10:40  

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
19822
Daniel Stein 2014.03.24 11:26  

Thanks GumRai,

i got my error.

cheers

Keith Watford
Moderator
8026
Keith Watford 2014.03.24 13:48  
blueball:

Thanks GumRai,

i got my error.

cheers


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