Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Kate W.NinjaTrader Customer Service

    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.
          Kate W.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by zstheorist, Today, 07:52 PM
          0 responses
          5 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          150 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          6 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          6 views
          0 likes
          Last Post tkaboris  
          Working...
          X