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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    56 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    57 views
    0 likes
    Last Post PaulMohn  
    Working...
    X