Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Ownership of drawing objects

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

    Ownership of drawing objects

    Hello!

    My indicator draws some text objects on the price panel. The problem is that I'd like to delete some of them without also removing the indicator that created them. Is it possible to dissociate a drawing object from the indicator or to assign it to a different owner?

    #2
    Hello Gianpiero,

    To remove an object your indicator can do that in its logic. You would use the RemoveDrawObject("tag") method.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you, that's interesting regarding a different approach to my problem. However, that's not exactly what I was looking for. I didn't explain myself clearly. What I want to do is to delete manually some text drawn algorithmically without also deleting the indicator from the chart

      Comment


        #4
        Hello Gianpiero,

        If a script draws an object that script owns the object through its lifecycle. To remove the object you would need to program into that indicator a way for it to delete it. That would be based on conditions or in a more advanced case you could add a custom button to the chart which calls RemoveDrawObject in the indiators code.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Ok, I understand, but how would I add such a button? Moreover, is it possible to assign a different owner instead of 'this'?

          Comment


            #6
            Hello Gianpiero,

            The owner would need to be the script which is managing it, that can be the indicator that draws it. There is not a way remove the owner so you can manually delete objects. You would need to make logic in that script to manage the objects in the way that you wanted.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rtwave, 04-12-2024, 09:30 AM
            5 responses
            37 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by funk10101, Today, 12:02 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by GLFX005, Today, 03:23 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by nandhumca, Yesterday, 03:41 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by The_Sec, Yesterday, 03:37 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X