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

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Great, thank you!

          Comment


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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            44 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            180 views
            0 likes
            Last Post jeronymite  
            Started by DanielSanMartin, Yesterday, 02:37 PM
            2 responses
            13 views
            0 likes
            Last Post DanielSanMartin  
            Working...
            X