Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    65 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Working...
    X