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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X