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