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 SalmaTrader, 07-07-2026, 10:26 PM
            0 responses
            50 views
            0 likes
            Last Post SalmaTrader  
            Started by CarlTrading, 07-05-2026, 01:16 PM
            0 responses
            22 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 06-17-2026, 10:32 AM
            0 responses
            16 views
            0 likes
            Last Post CaptainJack  
            Started by kinfxhk, 06-17-2026, 04:15 AM
            0 responses
            22 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Started by kinfxhk, 06-17-2026, 04:06 AM
            0 responses
            23 views
            0 likes
            Last Post kinfxhk
            by kinfxhk
             
            Working...
            X