Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Are minute bars built or retrieved in real-time?

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

    Are minute bars built or retrieved in real-time?

    Hello,

    I am trying to gain a better understanding of the order of events inside the OnBarUpdate() method.

    I read the http://www.ninjatrader.com/support/h..._are_built.htm section, but still have 2 questions here...

    1) I understand minute bars are retrieved from the data provider when a new 1min chart is created. I also understand 1min bars are built/estimated tick-by-tick in real-time when inbetween minute intervals (such as 9:45:33). But what happens when the minute bar is completed and a new bar begins to form... is the previous completed minute bar then downloaded from the data provider to replace the one NT was building using ticks? or all real-time bars created by NT using tick data only?


    2) Regarding multiseries...
    suppose I have two 1min series on a chart, if I get the first tick of a new bar, using
    if(FirstTickOfBar && BarsInProgress == 0)

    ...and then use that event to do some calcs using both series ( for example: Closes[0][0] + Closes[1][0] ) am I guaranteed that Closes[1][0] will be of a timestamp corresponding with the appropriate new bar? or is there any chance that Closes[1][0] could still have a timestamp corresponding to data that would still be associated with the prior bar?

    #2
    ntfred, thanks for the post - in real-time the bars are build off incoming tick data, there's no automatic redownload of server side recorded data, this would only be triggered via right click on the chart > Reload Historical data. If desired NT can also save this realtime data for you in the repository (Tools > Options > Data), however if you have a connection that can offer backfilling we would not advise using as it can impact performance.

    There's no guarantee that bar would have updated as well, NT is completely event driven, so if no tick happened to close the prior bar and open a new one > then you would see the last known 'most current' timestamp used.

    Comment


      #3
      Thanks Bertrand, this is exactly what I needed!

      One last question on this topic... Is it possible to use code inside OnBarUpdate to do the "chart > Reload Historical data" routine you mentioned? Obviously not on every tick, but perhaps once every 10 minutes or so?

      Comment


        #4
        You are welcome ntfred - unfortunately that programmatic reload would not be built in, clients have though used an approach via C# SendKeys to 'access' the Ctrl+Shift+R key to trigger this.
        Last edited by NinjaTrader_Bertrand; 03-05-2013, 12:16 PM.

        Comment


          #5
          Great, thank you!

          Comment


            #6
            More specifically, I would suggest looking into http://www.ninjatrader.com/support/f...3&postcount=10

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X