Hello everyone,
I have a problem to determine the highest and lowest of ATR in X minutes. With those values, I want to calculate the average ATR in real time.
I code this, but I have a message of error (nb is not an Integer):
nb = intradaybarindex
atrmax = highest[nb](AverageTrueRange[14](close))
atrmin = lowest[nb](AverageTrueRange[14](close))
middle = ABS((atrmax+atrmin)/2)
return middle
Thank you for your help.
I wish you a perfect day
For these instructions, the period must a rounded value (not containing decimal = integer type of variable).
But the problem here is that the intradaybarindex start at 0, so a period of 0 is also not possible:
atrmax = highest[max(1,nb)](AverageTrueRange[14](close))
atrmin = lowest[max(1,nb)](AverageTrueRange[14](close))
Logic, indeed!
Thank you for your kind help Nicolas.