iHighest returning wrong index for higher number of bars.

mail4kafi
12
mail4kafi  

I am experiencing a strange problem using iHighest to find out the index of the highest bars.

It works for smaller number of bars, but if i test it with large number of bars then its giving me meaningless index value.


int val_index=iHighest("EURUSD",5,MODE_HIGH,650,600);

Print(val_index);

the code above printing 1220 but the index value should be something between 650 to 600.

Mohamad Zulhairi Baba
26808
Mohamad Zulhairi Baba  
mail4kafi:

int val_index=iHighest("EURUSD",5,MODE_HIGH,650,600);

the code above printing 1220 but the index value should be something between 650 to 600.

Read the manual https://docs.mql4.com/series/ihighest

iHighest - Timeseries and Indicators Access - MQL4 Reference
iHighest - Timeseries and Indicators Access - MQL4 Reference
  • docs.mql4.com
iHighest - Timeseries and Indicators Access - MQL4 Reference
William Roeder
24189
William Roeder  
mail4kafi: the index value should be something between 650 to 600.

The index value should be between [600 … 1249] assuming you have at least 1250 bars.