Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-series strategy

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

    Multi-series strategy

    Hi!

    Is there any statement or method to allow a strategy know when all series added have had an incoming close or tick? I mean, I'm using the Closes[x][0] and sometimes when there is no action in the markets for one instrument, the Closes launches an error by refering to a array that has no input, I know that I can do this by developing some boolean variables that analizes when has come a input for an Instrument, but perhaps there is something better.

    Thanks

    #2
    joanNT, you would need to filter your code logic by checking which BarsInProgress calls the OnBarUpdate of the strategy -

    Comment


      #3
      Yes Bertrand, this way I already know, another way?

      Thanks

      Comment


        #4
        No, not really - the bars objects are updated then in the sequence in which you've added them. For dataseries inputs of indicators for example you could also point to the direct bars array without BIP context -

        Comment


          #5
          One consideration, the objects aren't updated in the sequence I've added allways, cause this depens on which time series you have, of course when added differents instruments with the same time series they are updated in sequence. I'm right?

          Bertrand what do you mean with BIP context, do you have an example?

          Thanks!

          Comment


            #6
            Right, sorry should have been more clear - was referring to different instruments and same timeframe.

            For example, Close[0] refers to the Close of the first added series if called with BIP 1 context -

            Code:
             
            if (BarsInProgress == 1)
            myClose = Close[0];
            Which would in turn equal Closes[1][0].

            Comment


              #7
              Ok, to clarify I've this portion of code:

              if (BarsInProgress == 0) first = true;
              if (BarsInProgress == 1) second = true;
              if (BarsInProgress == 2) third = true;

              if (!first || !second || !third) return;

              Is there a faster way to do the same?

              Thanks

              Comment


                #8
                No, as there's no general method to check all BIP's.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                649 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                370 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                109 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                574 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                576 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X