hello again
I was wondering if any of the programming wizards could help with some simple code…
I would like to calculate the value of an indicator (ATR) on a previous bar so that I can potentially open positions if the volatility is rising… I was thinking of using just 2 bars for this. This will act somewhat like a filter.
Simply put: if after 2 bars the volatility is rising based on the ATR value, then I will look to open a position on the 3 bar (using a trigger from a lower time-frame). I hope this makes sense.
Kind Regards
Jim
Simply use [N] to refer to the previous Nth bar.
ATR = AverageTrueRange[14](close)
IF ATR[2] THEN //check the ATR value 2 bars ago
.
.
ENDIF