Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Confusion on Event Driven OnBarUpdate Mechanism for Multiple Instrument Strategy

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

    Confusion on Event Driven OnBarUpdate Mechanism for Multiple Instrument Strategy

    Hi,

    When I tried to develop a multiple instrument strategy. I noticed the following problem.

    The strategy involves two instruments, one for trading and the other for reference only. Lets refer them as "Pri" and "Ref".

    Here are the settings:
    CalculateOnBarClose=true;
    Bar period is set to 1-minute;


    Then comes my confusion:

    Suppose Time[0] is now 11:00 AM. In function OnBarUpdate, if BarsInProgress==0 then this event is driven by "Pri". But at this moment, all the data series for "Ref" are still at 10:59 AM. I.e., Closes[0][0] is the close price of Pri at 11:00 however Closes[1][0] is the close price of Ref at 10:59!

    How could I access the synchronized data series of Ref correctly?



    I'd appreciate any ideas or suggestions. Thx.

    #2
    We'll work out a sample shortly.

    Comment


      #3
      You could try driving your logic on BarsInProgress == 1. Based on the order you have the series, different bar series will fire first. If you want both to be on 11am before you run any logic you will want to wait till the last bar series fires.

      Are you using two 1-min series? On different instruments? Or a different setup?
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        I thought about this. But how to Open/Close a position of another instrument? The EnterLong*/EnterShort*/Exit* functions all defaults to *current* instrument.

        Comment


          #5
          Hi shliang,

          You will be pleased with the new feature in NT6.5 which allows you to specify which barsInProgress your order will be executed on.

          EnterLong(int barsInProgressIndex, int quantity, string signalName)
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Sounds great

            When will NT6.5 be released? I can't wait!

            Comment


              #7
              NT6.5 is in beta right now. Release should be available sooner than later. No fixed ETA yet.

              Comment

              Latest Posts

              Collapse

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