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

When Does Daily Bar Close?

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

    When Does Daily Bar Close?

    I'm running a custom indicator on a daily chart with the Equities RTH trading hours set. (Hours are 9:30am - 4pm, I believe).

    What I'm wondering is when does OnBarUpdate get called for the current day bar closing? I would expect it to be at 4pm. But I am logging Time[0] in OnBarUpdate and it is still showing 7/20 as the last bar to complete, even though it is currently 4:53pm on 7/23.

    Basically I want the indicator to update at 4pm so I can make a trade decision before the actual end of trading.

    Any help or tips would be appreciated.

    #2
    Hello calebsandfort,

    With any bar, the bar does not close until a new bar is opened.

    For a daily bar, the day bar closes at the first tick of the next session.

    You could use a timer to trigger an action exactly at 4:00 PM.

    (Or you could add a secondary tick series and trigger a few seconds before 4:00 PM using ticks to drive the action while the market is open)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea

      That makes sense. I now have a secondary data series calculating the indicator value for the current day. That seems to work. However inside of that code I do

      Values[0][0] = ...

      to update the value I'm seeing on the chart, but it isn't drawing it. Should this be possible or will that value not display until the new bar is opened?

      Comment


        #4
        Hello calebsandfort,

        In the parameters of the Strategy window, if Calculate is set to 'On price change' or 'On each tick' in realtime (or historically with TickReplay enabled) 0 barsAgo ([0]) will refer to the currently building primary bar. If Calculate is set to 'On bar close' 0 barsAgo will refer to the most recently fully closed bar.

        Below is a public link to the help guide on Calculate.


        And a public link to the help guide on how bar data is referenced.


        What is Calculate set to?
        Are you seeing the price of the most recently fully closed price change instead?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Kaledus, Today, 01:29 PM
        0 responses
        3 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by PaulMohn, Today, 12:36 PM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by yertle, Yesterday, 08:38 AM
        8 responses
        37 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by rdtdale, Today, 01:02 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X