Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble Accessing Previous ATR Indicator Values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trouble Accessing Previous ATR Indicator Values

    Hello,

    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:
    Click image for larger version

Name:	image.png
Views:	130
Size:	28.7 KB
ID:	1302284
    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.​

    #2
    I want to base it off of pips if that helps.

    Comment


      #3
      Hello AaronKTradingForum,

      Thank you for your post.

      How have you confirmed this value is incorrect?

      I recommend adding prints to debug. Add a print that prints out the time of the bar and the value of the ATR.

      For example,

      Print(Times[0][0] + " ATR(14)[1]: " + ATR(14)[1]);

      What values are you seeing printed out for the ATR using the print statements?

      Please let me know if I may further assist with analyzing the output.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      38 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X