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 07-19-2012, 11:57 PM   #1
Driftintoad
Junior Member
 
Join Date: Nov 2010
Posts: 21
Thanks: 6
Thanked 0 times in 0 posts
Default Referencing timeframe

Hi guys.

Is there a way to reference the time frame chosen in a strategy? I need it so I can create my secondary bars time-frame as I work in multiples of 3. For example if primary bars is selected as 1500 tick then secondary bars needs to be 500 tick. For example what I am trying to do is this.
Initialize
{
eg. Add(PeriodType.Tick.PrimaryBars / 3);
}

Thanks

Ash
Driftintoad is offline  
Reply With Quote
Old 07-20-2012, 02:54 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,564
Thanks: 261
Thanked 1,015 times in 996 posts
Default

Hi Ash, unfortunately we could not support the dynamic addition of series - you can query the series you're working with over the BarsPeriod.Id and Value, however only outside of Initialize().

For your need, I would create custom inputs for the series to load, so the user sets the timeframe to a third as needed via the input.
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 07-20-2012, 09:22 PM   #3
Driftintoad
Junior Member
 
Join Date: Nov 2010
Posts: 21
Thanks: 6
Thanked 0 times in 0 posts
Default

Cheers for the response Bertrand. Good idea, I will just create user inputs for the time frames as suggested.

Thanks

Ash
Driftintoad 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
Referencing DataSeries with multi timeframe indicators trader2be General Programming 5 01-06-2011 06:35 AM
Multi-timeframe strategy skips lower timeframe bars at one point adamus Version 7 Beta General Questions & Bug Reports 13 07-03-2010 01:36 AM
Multi-timeframe indicator referencing LazKz Strategy Development 3 03-18-2009 07:24 AM
How to get higher timeframe data to make entry decision at lower timeframe? cunparis Strategy Development 1 03-11-2009 12:41 PM
Referencing DataSeries elements in Multi-timeframe Strategies dbw451 Strategy Development 2 09-06-2008 09:17 AM


All times are GMT -6. The time now is 05:45 AM.