Could somebody please help correct me with the proper syntax on this code? If trying to refer to the ATR of a previous hour would it be:
Neither throw an error. I was experimenting with adding/subtracting ATR to an average high/low and the plots just don't seem quite right, I suspect something is throwing off the data. I remember reading somewhere that TOS will use highest offset so I'm not sure if my average length being longer than ATR length is effecting it or my syntax
Thanks in advance
Code:
def atr = average(TrueRange(high(period = aggregationPeriod.HOUR),close(period = aggregationPeriod.HOUR),low(period = aggregationPeriod.HOUR))[1],length);
- OR MAYBE -
def atr = average(TrueRange(high(period = aggregationPeriod.HOUR)[1],close(period = aggregationPeriod.HOUR)[1],low(period = aggregationPeriod.HOUR)[1]),length);
Neither throw an error. I was experimenting with adding/subtracting ATR to an average high/low and the plots just don't seem quite right, I suspect something is throwing off the data. I remember reading somewhere that TOS will use highest offset so I'm not sure if my average length being longer than ATR length is effecting it or my syntax
Thanks in advance