Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing objects are not being created

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

    Drawing objects are not being created

    I wrote an indicator that creates a bunch of drawing objects (see a screen shot attached). It works just fine.

    However, when I create this indicator from another indicator no drawing objects is being created. From the log I see that the internal logic of the indicator works properly but everything that is Draw.<some object like Rectangle or ArrowUp> is just being ignored like it does not exist in the code.

    How does my indicator know that it is created from the code vs added to the chart from Ninja's GUI and how do I make it draw when it is created from the code?
    Attached Files

    #2
    Hello LeonK,

    That would be expected if you are using the indicator from within a different indicator. Only the primary indicator will display objects. Hosting an indicator would be when you call an indicator in code, applying it to the chart will give it an instance to the chart to be able to draw.

    Comment


      #3
      Hosting an indicator would be when you call an indicator in code, applying it to the chart will give it an instance to the chart to be able to draw.
      Hi Jesse,

      Any example or explanation how I can make that hosted indicator to draw? It just does not make sense to repeat all the drawing code in the hosting one.

      Thanks

      Comment


        #4
        Hello LeonK,

        You could use a Strategy instead of an indicator, strategies have AddChartIndicator. https://ninjatrader.com/support/help...chartindicator


        Otherwise you would need to extract the code from that indicator and use it within your hosting indicator. Hosting an indicator means the hosted indicator is not visible on the chart, your using it behind the scenes so its not going to be displayed at all.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X