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:	148
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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X