NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-05-2011, 03:08 PM   #1
buylosellhi
Member
 
Join Date: Mar 2011
Posts: 83
Thanks: 0
Thanked 0 times in 0 posts
Default Syncing custom DataSeries to secondary series

Hi,

Just trying to get familiar with the way DataSeries objects work. If I need to sync a custom dataseries I can definite by using DataSeries(this). If I add more series to the indicator, how do I sync the custom DataSeries object to the secondary series added using Add().

Hope i'm clear in what I'm asking.

thanks
buylosellhi is offline  
Reply With Quote
Old 05-05-2011, 03:10 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello buylosellhi,

Yes, there is a sample dedicated to this here:
http://www.ninjatrader.com/support/f...ead.php?t=3572
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-05-2011, 03:26 PM   #3
buylosellhi
Member
 
Join Date: Mar 2011
Posts: 83
Thanks: 0
Thanked 0 times in 0 posts
Default

Ryan, thanks for your reply. In the example that you provided the secondaryDataSeries is synced using

secondarySeries = new DataSeries(SMA(BarsArray[1], 50));

do we need to use an Indicator with the appropriate BarsArray[] to sync it or can it also be synced using

secondarySeries = new DataSeries(BarsArray[1]);

thanks again...
buylosellhi is offline  
Reply With Quote
Old 05-05-2011, 03:37 PM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Yes, you can do that, although you might not need a data series. You can access the close series of the secondary time frame with:
Closes[1]

Don't include the second bracket [ ] and it's a series, not a double.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 08-11-2011, 09:30 PM   #5
Light
Member
 
Join Date: Jan 2010
Posts: 66
Thanks: 0
Thanked 0 times in 0 posts
Default Can't synchronize secondary series directly with BarsArray[1]

Guys, synching the secondary series using an indicator like the SMA appears to work fine, as in the example zip file. But doing it directly via BarsArray[1], as in

secondarySeries = new DataSeries(BarsArray[1]);

didn't work for me. Not a big deal... just thought I'd mention it in case others try the same thing.
Light is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-Series Secondary Series LastBarPainted TAJTrades General Programming 1 02-05-2011 12:44 PM
Trades Not Executing On Secondary Series In Multi-Series Strategy BAltman Version 7 Beta General Questions & Bug Reports 33 11-03-2010 09:00 AM
NT7B7: DataSeries Sync to secondary bars is still broken kdoren Version 7 Beta General Questions & Bug Reports 3 01-28-2010 02:14 PM
NT7B6 Strategy: DataSeries sync to secondary Bars is broken kdoren Version 7 Beta General Questions & Bug Reports 4 01-12-2010 10:25 AM
Sync a DataSeries with a secondary timeframe jriverac Strategy Development 14 05-27-2008 01:19 PM


All times are GMT -6. The time now is 05:29 PM.