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-15-2008, 11:49 AM   #1
Mark_486
Junior Member
 
Join Date: May 2008
Posts: 14
Thanks: 0
Thanked 0 times in 0 posts
Default multi-time frame code and entry code

I'm using a mult-time frame strategy. I've referred to the help guide, but still have questions in two areas:

1. Is it best to use the barsinprogress ==0 for multi-time frame instead of barsinprogress !=0?

1a.If using ==0 format and you want to check the 1 minute chart as well as other time frames, should you be including in your time frame code:
// Add a 1 minute Bars object to the strategy
Add(PeriodType.Minute, 1);

or is the 1 min. time frame automatically assumed under the ==0 format?

2. Where do you place an enterlong() code on a multi-time frame strategy? I want an entry to occur only when the strategy conditions exist on all timeframes simultaneously.

Should the enterlong() code occur only once at the end of the code after all if statements have been written, or should it occur after each and every timeframe's if statement?
Mark_486 is offline  
Reply With Quote
Old 05-15-2008, 11:54 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

1. Depends what you want to do. If you want to process OnBarUpdates for the primary series then you need to filter using == 0.

1a. If your primary series is NOT 1 min, then yes, you must add it. If its the primary then it will have an index of 0 --> Refer back to answer #1

2. Only once
NinjaTrader_Ray 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
CurrentBar and Multi Time Frame maxpi Strategy Development 7 07-31-2009 01:07 PM
NT 6.5 vs 6.0 - Multi Time Frame Behavior kgillis23 General Programming 8 03-27-2008 05:19 PM
Multi Time Frame/Multi Instrument? GreenTrade Strategy Development 3 01-14-2008 02:24 PM
Code->test/debug->change code->retest ... cycle process bbarroux Strategy Development 3 10-02-2007 12:44 PM
Multi-time frame scjohn Strategy Development 1 06-06-2007 07:20 PM


All times are GMT -6. The time now is 12:16 AM.