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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X