Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries with less Days to Load

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

    AddDataSeries with less Days to Load

    I am trying to load 6 dataseries 5M 30M 60M 1D 1W 1Month on each others charts. I have a lot of charts open so I keep my Bars to Load to 100 usually unless its a big pattern layout. This works for any time frame for a fairly small chart. However, I get the error:
    Error on calling 'OnBarUpdate' method on bar 0: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
    Because in order for me to use the 1 Month dataseries, I would need 219,000 5 minute candles to be able to use a 1 Month data series. I do not know NT well so I thought perhaps someone had a trick to be able to use a long term dataseries without having to load many candles to keep it light. See image for visual.

    Thanks for any help!
    Last edited by UncleRyan; 05-27-2020, 08:21 PM.

    #2
    Hello UncleRyan,

    Thank you for your post.

    There is an overload that allows you to specify the number of bars to load for additional data series; however, this may only be used if the secondary series is a different instrument and bar type from the primary.

    We have further documentation on the AddDataSeries command here: https://ninjatrader.com/support/help...dataseries.htm

    Using the overload with BarsToLoad would allow you to specify the number of BarsToLoad but that is assuming that the second series is not the same as the primary series in respect to using the same instrument and the same Bar Type. To answer your question, if the secondary is the same instrument and bar type, you would need to just load that many bars on the primary series to achieve that goal. If the second series is not the same, you can specify a BarsToLoad in the overloads.

    So, no, in your case, you would need the strategy to load all the bars for each series.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Kate,

      Thanks for the clear information. That is very disappointing.

      Comment


        #4
        Since you were so knowledgeable I thought I'd see if this sounded possible: I know you can create your own bar types in NT - though I have never done it. Could you create a "new" bar type, but just make it candles like the primary series, but it would be an alias so to speak. Would that "trick" it into thinking its a different candle type so I could do the overload? Just a thought. Thank you for your explanations, I'm learning quite a bit.

        Comment


          #5
          Hello UncleRyan,

          Thank you for your reply.

          I'm actually not certain on that. I will do some testing and get back to you.

          Thanks in advance; I look forward to assisting you further.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          566 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          547 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          548 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X