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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            68 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            36 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            61 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            62 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            53 views
            0 likes
            Last Post CarlTrading  
            Working...
            X