which one is returned by iHighest() if therer are two equal highs?

 
Hi,

If I have a data list below:
Bars 7 6 5 4 3 2 1 0
MODE_HIGH 111 99 111 88 77 66 33 55

Does iHighest(symbol,tf,MODE_HIGH,amount,0) return 7 or 5?

If it returns 5, how can I get 7 from these specific number of bars ?


Thank you!
 

I find a good example manually. After debugging, I can confirm that iHighest() will return the smallest one if there are >1 equal highs.

The question is still here. Can I get the biggest shift of bars from iHighest()?

--- Update: I find an alternative way to fix my own code. Just to compare the high of each bar with the highest value.

 

You could go forward.


depending on the "series" of your array. - lets say biggest index = newest value.


When you query the array by using ArrayMaximum, or by iHighest, you get a result.

Then you do the same call again, but you shift the "scope" you are investigating plus one from the value you found in the previous call.

 
Li Bo:
Hi,

If I have a data list below:
Bars 7 6 5 4 3 2 1 0
MODE_HIGH 111 99 111 88 77 66 33 55

Does iHighest(symbol,tf,MODE_HIGH,amount,0) return 7 or 5?

If it returns 5, how can I get 7 from these specific number of bars ?


Thank you!

If you want to find a double top must write your own code/function instead of iHighest.

If you just need the highest price it does not matter.

Reason: