Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator not being called

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

    Indicator not being called

    I have a strategy that calls AddChartIndicator in the DataLoaded state.
    However, the indicator's OnBarUpdate method is not being called (it is not executing the Print statement there).
    Can you tell me why?
    See code provided in attached zip.

    Thanks,
    Gary
    Attached Files

    #2
    Hello GaryAlbers,

    Thanks for your post.

    You would need to access your indicator in OnBarUpdate() of the strategy if you want to see historical OnBarUpdates in the indicator. In the help guide for addChartIndicator(0 is this tip: If you are adding an indicator which is dependent on the correct State of the indicator, you will need to ensure that you are also calling the indicator from the strategy in OnBarUpdate(), otherwise your indicator will only process in State.RealTime for performance optimizations. The help guide shows an example using an SMA as an added indicator and then accessing the indicator in the strategies OnBarUpdate(), please see: https://ninjatrader.com/support/help...tindicator.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    91 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    121 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    72 views
    0 likes
    Last Post PaulMohn  
    Working...
    X