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 charlesugo_1, 05-26-2026, 05:03 PM
                0 responses
                55 views
                0 likes
                Last Post charlesugo_1  
                Started by DannyP96, 05-18-2026, 02:38 PM
                1 response
                142 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 05-11-2026, 05:56 AM
                0 responses
                160 views
                0 likes
                Last Post CarlTrading  
                Started by CarlTrading, 05-10-2026, 08:12 PM
                0 responses
                96 views
                0 likes
                Last Post CarlTrading  
                Started by Hwop38, 05-04-2026, 07:02 PM
                0 responses
                276 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Working...
                X