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 warreng86, 11-10-2020, 02:04 PM
        5 responses
        1,357 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        3 views
        0 likes
        Last Post Perr0Grande  
        Started by elderan, Today, 08:03 PM
        0 responses
        5 views
        0 likes
        Last Post elderan
        by elderan
         
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        12 views
        0 likes
        Last Post maybeimnotrader  
        Working...
        X