NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-18-2009, 11:50 PM   #1
Shansen
Senior Member
 
Join Date: Jan 2009
Location: Melbourne
Posts: 178
Thanks: 3
Thanked 0 times in 0 posts
Default Multi-time frame strategy - Longer-term real-time calculations

All,

Here's a curly one. Where a custom NinjaScript multi-time frame strategy has primary bars of say 5min and secondary bars of say 60mins (generally longer-term), is it possible to have the longer-term secondary bars calculate real-time while the primary bars calculate on bar close?

I've designed indicators that operate separately on the two different time frames, and intended to bring them together with a multi-time frame strategy. The longer term indicator is "CalculateOnBarClose = false;" while the short-term indicator is "CalculateOnBarClose = true;". The strategy script that combines these two indicators and operates with the primary bars as 5min is "CalculateOnBarClose = true;".

At this stage, I've only run this strategy on historical data. Understanding that this strategy would have to be run in real-time to be correctly tested, is it likely to work, or possible?

As always, thanks
Shannon
Shansen is offline  
Reply With Quote
Old 04-19-2009, 06:36 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Hi Shansen, for backtesting purposes you might want to look at this sample here - http://www.ninjatrader-support2.com/...ead.php?t=6652

In realtime you could work with FirstTickOfBar and CalculateOnBarClose set to false, then you can reference your 5 min calculations in this wrapper and the 60 min ones outside of it. Of couse you would have to reference one bar back more in the first case to compensate for calling the calculations on the open of the next bar.
NinjaTrader_Bertrand 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
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
Multi-time frame scjohn Strategy Development 1 06-06-2007 07:20 PM
Accessing High value in a multi time frame strategy PrTester Strategy Development 4 05-02-2007 01:13 AM


All times are GMT -6. The time now is 01:52 PM.