Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Multi-time frame strategy - Longer-term real-time calculations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    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.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    382 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    1 view
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Yesterday, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Working...
    X