Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help Guide says Don't do it

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

    Help Guide says Don't do it

    I would like to Add() two DataSeries to an indicator/Strategy. But I want to do it as a multiple
    of the compression of the Primary Data series. Example if the primary was 1 min I want the code to add in multiples of 7 times that or a 7 min and 49 min. The issue I see is that in Initialize where the add()'s would be, according to the help guide you are not supposed to access BarsPeriods[0].Value. which is the only way I see to get the primary data value the chart was created with.

    Does anyone know how this might be accomplished?
    Thanks

    Jerry

    #2
    Hello JerryWar,

    Thanks for your post.

    That is correct. It is not supported to add data series like this on the fly. I'm am not aware of a work around.

    You can do this and it may work, but please note that it is not supported to do so.

    Also, you would want to use BarsPeriod and not BarsPeriods[0].

    For example:

    Add(BarsPeriod.Id, BarsPeriod.Value*7);
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ChelseaB
      Thanks especially for the suggestion. Its easy enough to give it a try. My only hesitation was that it might actually work but cause seemingly unrelated issues later on.

      Jerry

      Comment


        #4
        Jerry,

        Really its not supported because its really easy to get in to trouble when doing things with this.

        What you are asking for is fairly straight forward and should work fine and continue to work fine as long as you are only doing this.

        Using multiple data series and trying to use BarsPeriods[1] or doing incrementing or trying to use an if statement to decide how many data series to use can cause NinjaTrader to out right crash.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Chelsea,
          It does appear to work great. It makes my life much simpler. I will stay away from the conditional statements. I can see where I might have tried it.

          Thanks
          Jerry

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          344 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          557 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X