![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jan 2009
Location: Melbourne
Posts: 178
Thanks: 3
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |