• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by superkolleech, Today, 12:46 AM
    1 response
    11 views
    0 likes
    Last Post MojoJojo  
    Started by davidwade, Today, 02:51 AM
    0 responses
    3 views
    0 likes
    Last Post davidwade  
    Started by aviat72, 04-26-2020, 09:41 PM
    10 responses
    91 views
    0 likes
    Last Post kissandfly  
    Started by healthooa, Today, 01:28 AM
    0 responses
    7 views
    0 likes
    Last Post healthooa  
    Started by harjinderjit, Yesterday, 08:24 PM
    0 responses
    20 views
    0 likes
    Last Post harjinderjit  
    Working...
    X