Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

When are indicators updated?

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

    When are indicators updated?

    In a multi-instrument strategy working with real time tick data,

    Initialize()
    CalculateOnBarClose = false

    OnBarUpdate()
    {
    if (FirstTickOfBar)
    {
    if(BarsInProgress == 0)
    RSI(BarsArray[0], 14, 1)[0]; //Is this indicator in updated state?
    }
    }

    Is it guaranteed that the indicator is in an updated state when the strategy reads the current value [0]?

    If not, how can it be assured that it is?

    It is not clear when indicators are updated in relation to the FirstTickOfBar becoming true and the strategy execution.

    #2
    Hello Camdo,

    Yes, plots will be updated. The exact alignment of multiple bar objects depends on which two series you're using and if accessing on historical or real time data. It helps to print the time stamps of all series so you can check this.

    if (BarsInProgress == 0 && FirstTickOfBar)
    Print("Primary Series Time Stamp: " + Time[0] + " Secondary Time Stamp: " + Times[1][0]);
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X