Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi instrument strategy question

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

    Multi instrument strategy question

    I have coded a strategy were:
    0) Primary Bar is 6 Range Bars
    1) Secondary Bar is Tick Bars

    When OnBarUpdate() is executed for a Tick, what value should Closes[0][0] have?
    Is it for the previous Range bar or the current Range bar?

    My observation is that:
    when executed on historical data, Closes[0][0] refers to the previous Range bar.
    when executed on live data, Closes[0][0] refers to current Range bar.

    Is this correct or am I missing something?

    #2
    afshinmoshrefi, this would be expected if you're working on CalculateOnBarClose = false.

    This will be 'true' for all historical bars, but for realtime be working as set.

    Comment


      #3
      so if I understand correctly, on historicals when a tick executes OnBarUpdate, even when I set CalculateOnBarClose = false, Close[0][0] refers to the previous primary bar that already has closed not the current primary bar that the tick is a part of?!

      Comment


        #4
        Correct Close[0][0] will be the last completed bar in historical processing.

        Comment


          #5
          Thanks, Your explanation clears a lot of confusion

          Comment


            #6
            Glad to hear - have a nice day.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            65 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            149 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            162 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            99 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            286 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X