I am currently developing an algorithm, and a part of my algorithm uses the Ninja Trader 8 built in indicator ATR
I want to use it for a stop loss in my system. The algorithm is based off of the 30 min chart.
The algo should take the ATR value, multiply it by 1.5, and then round the final value up.
In terms of the ATR value I want, it ideally needs to be the ATR from the previous 30M candle, for example:
The ATR is 5.55 for the last candle - that being the red one.
I am using this as a calculation: double stopLossPoints = (double)Math.Ceiling((ATR(14)[1] * 1.5));
But when I try to access the previous ATR value, I get values such as 0.124 or 0.26274.
I am not sure how to get around this. I want to be able to access the value from the previous candle (so like in this picture, that would be 5.55), but it is giving me the wrong values.
Comment