NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 11-12-2009, 01:00 AM   #1
PolarBear
Member
 
Join Date: Jun 2008
Posts: 62
Thanks: 0
Thanked 3 times in 3 posts
Default Adding minute and daily data to a strategy

Hi,
I'm creating an intraday strategy using minute data. I also want to be able to use values from the previous day (ie: open, close, etc of previous day).

In the initialise function for the strategy, i use:

Add(PeriodType.Minute, 3);
Add(PeriodType.Minute, 20);
Add(PeriodType.Day, 1); // doesn't work with this line inserted

I run the strat with 1min bars selected in the strat options.
I access the different data for different timeframes the usual way,
eg: Closes[1][0] (for say the 3 minute data).

If i put in the 3rd add as above, to add the daily data (i would presume), the strategy doesn't run through. I don't get any error in the log output. Strategy appears to run, but if I put any debug "Print" statements in to see if it's cycling through each "onbarupdate" call, i don't get any output in the output window.
I'm assuming there's some kind of error but it's not reporting it.

I'm wanting to be able to access data from the previous day, so can do calls such as:
Closes[3][1] for example
or current daily data (eg high of current day):
Highs[3][0]

thanks
daniel
PolarBear is offline  
Reply With Quote
Old 11-13-2009, 11:08 AM   #2
Buthus
Junior Member
 
Join Date: May 2009
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
Default

Maybe you just don't receive daily data. Can you see any bar when you open a chart with the interval set to 1 Day bars? If you can't see any bar you can still access daily data by using the interval 1440 Minute bars.

The prior days OHLC can be easily accessed with the PriorDayOHLC indicator.

Regards,
Daniel
Buthus 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
Mixed minute/daily time frames? monpere Strategy Development 12 06-08-2011 04:10 PM
data series minute -> daily , => crash zweistein Version 7 Beta General Questions & Bug Reports 5 10-16-2009 03:28 PM
Minute and Daily Historical Data. Scooter1 Charting 1 12-15-2008 08:00 AM
Conversion of minute charts to daily linwj Charting 6 11-12-2008 08:11 AM


All times are GMT -6. The time now is 03:48 AM.