Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Instrument CurrentBar Question

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

    Multi-Instrument CurrentBar Question

    Hi,

    I'm developing a multi-instrument strategy adding 9 more instruments.
    Min bar is set to 20.

    I have the following code :
    Code:
    protected override void OnBarUpdate()
            {
                if (BarsInProgress != 0) return;
                Print("CurrentBar =" + CurrentBar);
                Print("CurrentBars[0] =" + CurrentBars[0]);
                Print("CurrentBars[3] =" + CurrentBars[3]);
                Print("CurrentBars[8] =" + CurrentBars[8]);
                Print("CurrentBars[9] =" + CurrentBars[9]);
            }
    The output I get is:
    CurrentBar =335
    CurrentBars[0] =335
    CurrentBars[3] =335
    CurrentBars[8] =335
    CurrentBars[9] =21
    CurrentBar =336
    CurrentBars[0] =336
    CurrentBars[3] =336
    CurrentBars[8] =336
    CurrentBars[9] =22
    CurrentBar =337
    CurrentBars[0] =337
    CurrentBars[3] =337
    CurrentBars[8] =337
    CurrentBars[9] =23
    CurrentBar =338
    CurrentBars[0] =338
    CurrentBars[3] =338
    CurrentBars[8] =338
    CurrentBars[9] =24
    CurrentBar =339
    CurrentBars[0] =339
    CurrentBars[3] =339
    CurrentBars[8] =339
    CurrentBars[9] =25
    CurrentBar =340
    CurrentBars[0] =340
    CurrentBars[3] =340
    CurrentBars[8] =340
    CurrentBars[9] =26
    CurrentBar =341
    CurrentBars[0] =341
    CurrentBars[3] =341
    CurrentBars[8] =341
    CurrentBars[9] =27
    CurrentBar =342
    ...
    Can you explain to me this outcome?

    TX,
    Roy

    #2
    What instrument / timeframes do you Add() here Roy? OBU() Processing would be started once all series have see the min bars required...

    Thanks,

    Comment


      #3
      Do you mean that if 1 of the instruments have a less data all will wait for him to sync. with the other?
      The instruments are few stocks, time frame is daily and the data I'm getting is from Kinetick Real-time service.

      Comment


        #4
        Correct Roy, first OnBarUpdate() call you would see is where all series have satisfied their min bars requirements.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X