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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        134 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
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X