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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            669 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            378 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            111 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X