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 NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X