Hi,
I know the HIGHEST[n] function that gives the highest price for the last n candles.
Is it possible to get the HIGHEST price between 2 candles, say the nth and the mth, something like HIGHEST[n,m] ?
How to get the candle index corresponding to the HIGHEST output ?
Thanks
Fred
HIGHEST[n,m] is not supported, but you can use:
HIGHEST[n](source[m]) //source can be anything, CLOSE, HIGH, etc...
JSParticipant
Veteran
Hi,
You can search between two different candles for example between candle n and candle m:
HH = Highest[m-n+1](High[n])
To find the index of HH you make a loop through the relevant candles with HH as reference.
For example: HH between candle 3 and 10
HH = Highest[10-3+1](High[3])
For i=3 to 10-1
If High[i] = HH then
HHBarIndex=BarIndex[i]
EndIf
Next
ok, thanks ; I was trying to avoid the loop which can create perf issue if I’m not careful about the range..