Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Time Frame Processing Question

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

    Multi-Time Frame Processing Question

    Question: Is there a guaranteed order in which the Bars Objects will be called?

    ie.

    if I have a 1 minute primary, a 2 minute and a 3 minute (indices of 0,1,2 respectively)

    When onBarUpdate() is called, can I rest assured that the indices will be called in the same order that they are added?

    so first I'll evaluate my 1 minute, then my 2 minute and lastly my 3 minute bar object?


    And is this true for both indicators and strategies?


    Thanks

    Matt

    #2
    Matt, I will have someone get back to you tomorrow regarding this question.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Austin View Post
      Matt, I will have someone get back to you tomorrow regarding this question.
      Do we have an answer to this... Print statements show that things are fairly random....

      Would like to know what behaviors I can (or can't) expect from this....

      Thanks

      MAtt

      Comment


        #4
        Matt, the bars objects get called in the sequence they're added - if you have bars with the same timestamp, they are also processed in the original added order, please also check into this sample below -

        You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by

        Comment


          #5
          Just to be clear....

          If I have a primary that is 1 min, and I add() a 2 min in initialize,

          Then in OnBarUpdate() I have

          Code:
          {
          
          if(BarsInProgress==0)
          {
          // should print out twice ... 
          Print("BIP 0");
          }
          else if(BarsInProgress==1)
          {
          // should print out once...
          Print("BIP 1");
          }
          I should ALWAYS have in my output (in this order):
          BIP 0
          BIP 0
          BIP 1

          I'm just wanting to make sure that it can't ever be:

          BIP 1
          BIP 0
          BIP 0

          or
          BIP 0
          BIP 1
          BIP 0


          Thanks

          Matt

          Comment


            #6
            You're understanding is correct, for easier checking you could also use PrintWithTimeStamp -

            Code:
             protected override void OnBarUpdate()
            		{
            			if (BarsInProgress == 0)
            				PrintWithTimeStamp("BIP0");
            			
            			if (BarsInProgress == 1)
            				PrintWithTimeStamp("BIP1");
            		}

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            60 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            147 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            161 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            97 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            284 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X