![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2008
Posts: 7
Thanks: 0
Thanked 0 times in 0 posts
|
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"); } |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
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").
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |