Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Paul H.NinjaTrader Customer Service

    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
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 08:13 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DavidHP, Today, 07:56 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by kujista, Today, 06:23 AM
        3 responses
        10 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by Mindset, Yesterday, 02:04 AM
        2 responses
        18 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Working...
        X