Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get ATR() of last day's bar before today's open

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

    How to get ATR() of last day's bar before today's open

    Hello,

    how do I access (on a daily chart) yesterday's ATR from indicator code between last session close and new session's open? When I do ATR(5)[0] I only get ATR for the day before yesterday. (I understand that before session close, the last bar is still in progress, but this is after it has been closed.)

    Many thanks,

    Libor

    #2
    Hello Libor,

    Thanks for your post.

    Please set the indicator Calculation mode from On Bar Close to either On Each Tick or On Price Change. This change can be done in the indicator panel.

    Comment


      #3
      Hi, thank you for the quick answer. I do that already, when I need to get the value in the indicator plotted on a chart,

      What I don't know how to do is to get the value of ATR from code.

      Thanks,

      Libor

      Comment


        #4
        Hello,

        Thanks for your reply.

        In your code then you would also need to run with the calculate On each tick or On Price Change. You can segment your code so that some parts run on each tick and other parts run on each bar close if needed. Here is a link to a working example of this: http://ninjatrader.com/support/forum...ad.php?t=19387

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        646 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        367 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X