NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 09-02-2008, 10:57 AM   #1
bani789
Junior Member
 
Join Date: May 2008
Posts: 7
Thanks: 0
Thanked 0 times in 0 posts
Default Multi Timeframe Entries

If I wanted to make entries or stops on different timeframes, that are done after a certain condition in an if statement, do I need to specify the BarsInProgress index for both the if statement and the order entry? That may not be clear so here's an example.

if (BarsInProgress == 0
&& High[0] > High[1])
{
EnterLong(100, "Entry"):
}

Versus

if (BarsInProgress == 0
&& High[0] > High[1])
{
EnterLong(0, 100, "Entry");
}
bani789 is offline  
Reply With Quote
Old 09-02-2008, 11:12 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

If you already have an if statement for if (BarsInProgress...) then you do not need to do the EnterLong(0, 100,....). You should be fine with just EnterLong(100, "Entry").
NinjaTrader_Josh 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
Designing multi-instrument, multi-timeframe mikeyork Strategy Development 5 07-08-2008 08:47 PM
Multi Timeframe support Edgar V. Strategy Development 25 04-27-2008 06:49 PM
Volume for Multi-Timeframe GuyFB General Programming 8 02-01-2008 03:01 PM
Multi Timeframe error Learning1 Strategy Development 2 09-14-2007 07:53 AM
Multi-Timeframe use in a Strategy Freddie Strategy Analyzer 25 05-30-2007 07:02 AM


All times are GMT -6. The time now is 02:43 PM.