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

 NinjaTrader Support Forum Multi Time Frame strategy glitch.

 Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

 05-13-2009, 09:18 AM #1 pureporsche Junior Member   Join Date: Jan 2009 Posts: 26 Thanks: 0 Thanked 0 times in 0 posts Multi Time Frame strategy glitch. 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?
 05-13-2009, 09:26 AM #2 NinjaTrader_Josh 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 Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 05-13-2009, 09:35 AM #3 pureporsche 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?
 05-13-2009, 09:59 AM #4 NinjaTrader_Josh 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 Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule
 05-13-2009, 10:05 AM #5 pureporsche 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 Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News and Announcements     News and Announcements Application Technical Support     ATM Strategies (Discretionary Trading)     Automated Trading     Charting     Connecting     Installation and Licensing     Market Analyzer     Miscellaneous Support         Historical Version 7 Beta Threads             Critical Information - Please review             Version 7 Beta General Questions & Bug Reports         Historical NinjaTrader 6.5 Archive             Historical NinjaTrader 6.5 Beta Threads     Strategy Analyzer     SuperDOM and other Order Entry Windows NinjaScript Development Support     General Programming     Indicator Development     Strategy Development NinjaScript Educational Resources     Reference Samples     Tips NinjaScript File Sharing     NinjaScript File Sharing Discussion     Version 7 Indicators     Version 7 Strategies     Version 7 Miscellaneous Suggestions and Feedback     Suggestions And Feedback

 Similar Threads Thread Thread Starter Forum Replies Last Post Shansen Strategy Development 1 04-19-2009 06:36 AM kekkis Strategy Development 3 12-30-2008 05:26 AM GreenTrade Strategy Development 3 01-14-2008 02:24 PM ct Strategy Development 22 01-03-2008 12:22 PM PrTester Strategy Development 4 05-02-2007 01:13 AM

All times are GMT -6. The time now is 08:05 PM.

 -- Fixed Width ---- Fluid Width NinjaTrader Support Forum - Archive - Top