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 04-03-2009, 03:57 PM   #1
binwang2
Senior Member
 
Join Date: Jan 2009
Posts: 216
Thanks: 0
Thanked 1 time in 1 post
Default Add daily series to minute series

NJ experts,

I have a multiple time frame issue: I could not add Daily data series to minute data series.

In my case, the primary chart is 1 minute. I have no problem in adding another minute data series of different period, no problem in adding second and tick data series. But When i add day series and above, the program will not work. The compiling will be successful, though, without any error message.

I have simplified the issue in the following code. No variable is declared so this one can be tested by copy and paste.

Any comments/suggestions are welcome.

protectedoverridevoid Initialize()

{
//Add(PeriodType.Minute, 60);
//Add(PeriodType.Second, 30);
//Add(PeriodType.Tick, 30);
Add(PeriodType.Day, 2); // BarsInProgress == 1. BarsArray[1]
CalculateOnBarClose = false;
}
protectedoverridevoid OnBarUpdate()

{
if (Close[1]>Close[2])
{
Print(
"Data series 0 value is" + ATR(1)[0].ToString());
Print(
"Data series 1 value is" + ATR(BarsArray[1],1)[0].ToString());
}
}
binwang2 is offline  
Reply With Quote
Old 04-03-2009, 04:09 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

binwang2,

Are you making an indicator or a strategy? Multi-series indicators is currently not available. You can only do this in a strategy.
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-03-2009, 04:12 PM   #3
binwang2
Senior Member
 
Join Date: Jan 2009
Posts: 216
Thanks: 0
Thanked 1 time in 1 post
Default

I am doing it in a strategy.
No error message in compliling. But as long as it is at day level (week is the same), there will be no output.
binwang2 is offline  
Reply With Quote
Old 04-03-2009, 04:26 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

binwang2,

Please be sure you have enough data on all series. For daily bars you need to have at least 20 days.
NinjaTrader_Josh is offline  
Reply With Quote
Old 04-06-2009, 08:56 AM   #5
binwang2
Senior Member
 
Join Date: Jan 2009
Posts: 216
Thanks: 0
Thanked 1 time in 1 post
Default

Changed default settings to include at least 35 days of data. It works. Thanks.
binwang2 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
New Data Series nigeleyre Strategy Development 1 01-23-2009 03:45 PM
Data Series nigeleyre Strategy Development 3 01-07-2009 02:33 PM
data series argito Indicator Development 3 05-30-2008 11:06 PM
How to access daily data series from an indicator running on intraday charts? clearpicks Indicator Development 3 04-21-2008 06:57 AM
Pivot Series wagross Charting 1 02-09-2006 07:36 AM


All times are GMT -6. The time now is 08:33 AM.