Thanks for any help!
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!
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
NinjaTrader
AddDataSeries with less Days to Load
Collapse
X
-
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.
Thanks for any help!1 PhotoLast edited by UncleRyan; 05-27-2020, 08:21 PM.Tags: None
-
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
-
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
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mly916, Today, 09:48 PM
|
0 responses
4 views
0 likes
|
Last Post
by mly916
Today, 09:48 PM
|
||
Started by Mikey_, Today, 09:21 PM
|
0 responses
10 views
0 likes
|
Last Post
by Mikey_
Today, 09:21 PM
|
||
Started by cre8able, Today, 05:53 PM
|
3 responses
13 views
0 likes
|
Last Post
by cre8able
Today, 09:20 PM
|
||
Started by Aryan Kumar, Today, 09:04 PM
|
0 responses
4 views
0 likes
|
Last Post
by Aryan Kumar
Today, 09:04 PM
|
||
Started by yertle, Yesterday, 05:49 PM
|
3 responses
16 views
0 likes
|
Last Post
by Mindset
Today, 08:38 PM
|
Comment