Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Realtime Secondary Timeframe

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

    Realtime Secondary Timeframe

    Hello! I'm trying to code the next thing.
    I have main series of 5 min timeframe and secondary series of 60 min.
    On my secondary timeframe I have an SMA, and I want to calculate it not only on secondary Timeframe will close, but calculate it in realtime. How can I do this?
    And one more thing - I want to calculate 5min series on bar close. How to separate this logic? Thank you.

    #2
    Hello YevhenShynkarenko,

    Thanks for your questions.

    The hosting script can be set to Calculate.OnPriceChange, and each data series will be updated in realtime with each price change.

    If you would like to have certain actions happen following OnBarClose functionality when using Calculate.OnEachTick or Calculate.PriceChange, you can check IsFirstTickOfBar, and reference the bar that had just closed. I.E. use BarsAgo 1, or Close[1].

    If you want to separate logic between different data series, BarsInProgress checks would be used.

    IsFirstTickOfBar - https://ninjatrader.com/support/help...ttickofbar.htm

    BarsInProgress checks - https://ninjatrader.com/support/help...arupdateMethod

    We look forward to assisting.

    Comment

    Latest Posts

    Collapse

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