Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator not rendering when instantiated from Strategy

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

    Indicator not rendering when instantiated from Strategy

    The attached indicator draw some fixed text on a chart.
    I'm attempting to use the indicator from within a Strategy.
    AddChartIndicator works and creates the indicator object, however the "OnBarUpdate" event never fires in the Indicator and as such no items are drawn on the chart.
    Is there another method to invoke or property to set so that the instantiated indicator actually renders its contents on the chart?​
    Attached Files

    #2
    Hello fjwltn,

    To use AddChartIndicator you still need to call the indicator from the strategies OnBarUpdate so the indicator processes.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Trying to determine an efficient software architecture.
      Would like the price related data/graphics in an indicator, and the trading logic in a strategy.

      Seems like the referencing an Indicator from a Strategy is useful if there are dataseries within the indicator.
      Otherwise, as in my POC, if there are only graphic objects being drawn triggered by OnBarUpdate, those should be drawn from the strategy because they OnBarUpdate event doesn't fire for instantiated indicators.

      Is that accurate?

      Comment


        #4
        Hello fjwltn,

        When calling an indicator from a strategy you can have it draw, you need to call the indicator from the strategies OnBarUpdate so the indicators OnBarUpdate also runs. If you don't call it then the historical processing will be missing. Your other option would be to just include that logic in the strategy so it draws on its own.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rubiijonson, Today, 01:02 AM
        0 responses
        4 views
        0 likes
        Last Post rubiijonson  
        Started by fkronloff, Today, 12:25 AM
        0 responses
        3 views
        0 likes
        Last Post fkronloff  
        Started by Zadomani, Yesterday, 11:39 PM
        0 responses
        10 views
        0 likes
        Last Post Zadomani  
        Started by ToNovy, 01-27-2025, 11:22 PM
        20 responses
        197 views
        0 likes
        Last Post ToNovy
        by ToNovy
         
        Started by hypercube, 03-07-2025, 12:22 AM
        2 responses
        38 views
        0 likes
        Last Post hypercube  
        Working...
        X