![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2010
Posts: 406
Thanks: 22
Thanked 23 times in 12 posts
|
I am not sure that I am correctly initializing my DataSeries which I want to sync with my secondary data series. In Initialize() I'm doing:
Code:
Add(PeriodType.Minute,1); Code:
if (cumVol == null && BarsInProgress == 1)
cumVol = new DataSeries(this, MaximumBarsLookBack.Infinite);
if (cumVol != null && BarsInProgress == 1 && cumVol.ContainsValue(0))
Print("dataseries for bar " + CurrentBar + " is " + cumVol[0]);
Code:
Error on calling 'OnBarUpdate' method for indicator 'RelativeVolume' on bar 0: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart. http://www.ninjatrader.com/support/f...ead.php?t=3572 But it showed the example of initializing the secondary DataSeries with an indicator, and I am wanting to manually fill in the values. I suspect my initialization is incorrect, but I don't have any other reference to go by. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
JoshDance, please go alongside the example provided for the sync - it would need to be an indicator as it implements an IDataSeries interface so you can provide the BarsArray to sync to.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2010
Posts: 406
Thanks: 22
Thanked 23 times in 12 posts
|
And then do I manually go through the DataSeries when the indicator loads and in each OnBarUpdate() I can set my own values?
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
Correct, you can set your own values then in the correct BIP. What we discussed is just the initial sync.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2010
Posts: 406
Thanks: 22
Thanked 23 times in 12 posts
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Secondary Series and Data, Int, Bool Series | TAJTrades | General Programming | 1 | 03-24-2012 08:13 AM |
| Secondary data series in Indicator | mokodo | General Programming | 2 | 03-22-2012 04:35 AM |
| Syncing custom DataSeries to secondary series | buylosellhi | General Programming | 4 | 08-11-2011 09:30 PM |
| Referencing secondary data series for a strategy | daven | Strategy Development | 4 | 06-26-2011 08:46 PM |
| Weekend data not triggering on secondary time series | gert74 | Strategy Development | 12 | 08-28-2007 08:12 PM |