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 sjsj2732, Yesterday, 04:31 AM
        0 responses
        30 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        286 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        282 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        132 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        90 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X