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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        169 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        327 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        252 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        353 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        180 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X