![]() |
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
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jan 2009
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
Curious if some one can offer some info on this issue.
I have a multi time frame strategy on the same equity. CalculateOnBarClose = true; The primary [0] time frame is a 1 min and the second [1] is a 5 min. I have a strategy running on the 5 min time frame. Let's call it "Y". If Y is true --> Open a trade. This strategy works fine and triggers trades on the correct bars. I added a condition (lets call it "X") on the 1 min time frame. The condition "X" simply states: if X is true, do Y. As an example: When running Y only (this is on the 5 min time frame), I get a trade trigger that, for instance, is initiated on the close of the 10:35am bar, which means the trade is executed on open of the following bar at 10:40am. This is correct. However when altering this strategy and adding: if (BarsInProgress == 1) If Y is true --> set someVariable = 1 (do not open a trade) if (BarsInProgress == 0) If X is true & someVariable == 1 --> open a trade. What I'm noticing is that the Y trigger still takes place on the 10:35am bar. However the trade is only executed on the open 1 min after, hence on the open of the 10:37am (1min time frame) bar. Shouldn't this be triggered on the open of the 10:36am bar? Why is there a 1 min lag? |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Expected. At 10:35 you get the 5 minute signal. At 10:36 you check for condition x + y. It is evaluated to true, BUT since it was evaluated to true at the end of the 10:36 bar that bar is untradeable. Next tradeable location is the open of the 10:37 bar and that is where it is placed.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2009
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the quick answer!
However all conditions are true on the close of the 10:35 bar. Shouldn't execution in this case happen on the open of the 10:36 bar. So what you are saying, it's my understanding that in a multi time frame strategy, variables passed between different time frames require additional bars to execute? So for instance if I were to add an additional condition "M" for instance, on another time frame it would require another 1 minute (1 min chart) before execution? |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
No, you need to consider the order of events. 1 minute is your primary. You processed the 1 minute 10:35 before the 5 minute 10:35. Next call to 1 minute is 10:36.
If you want to get a signal from 5 minute and submit right away you should just use the overload method on your entry orders to place it to the correct BarsInProgress. EnterLong(int barsInProgressIndex, int quantity, string signalName) Roll all of your logic into 5 minute series. Use BarsArray[0] to check the 1minute for information instead of waiting for the next update to check. Then just send your order to BarsInProgress 0.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2009
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
Perfect! Thanks Josh.
I was starting to think this had to do with the sequence of events. Cheers! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi-time frame strategy - Longer-term real-time calculations | Shansen | Strategy Development | 1 | 04-19-2009 06:36 AM |
| Market Reply and Multi time frame Strategy problem | kekkis | Strategy Development | 3 | 12-30-2008 05:26 AM |
| Multi Time Frame/Multi Instrument? | GreenTrade | Strategy Development | 3 | 01-14-2008 02:24 PM |
| Multi time frame syncronize chart with strategy | ct | Strategy Development | 22 | 01-03-2008 12:22 PM |
| Accessing High value in a multi time frame strategy | PrTester | Strategy Development | 4 | 05-02-2007 01:13 AM |