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 TrippTraders, Yesterday, 07:14 PM
        1 response
        13 views
        0 likes
        Last Post brucerobinson  
        Started by decosenty, Yesterday, 11:33 PM
        0 responses
        9 views
        0 likes
        Last Post decosenty  
        Started by RicharBarrio, Yesterday, 11:26 PM
        0 responses
        7 views
        0 likes
        Last Post RicharBarrio  
        Started by paulo_br, 09-13-2024, 08:41 AM
        8 responses
        1,155 views
        0 likes
        Last Post AppleID25  
        Started by mno_om, Yesterday, 08:44 PM
        0 responses
        11 views
        0 likes
        Last Post mno_om
        by mno_om
         
        Working...
        X