Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Allow Removal of Object

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

    Allow Removal of Object

    Hi,

    In NT7 there was a command "AllowRemovalOfObject" that, if set to true, allowed for objects drawn by an indicator to be manually removed later on.
    I did a search on this forum, but found nothing similar for NT8.
    Does something like this exist?

    Thanks

    #2
    Hello laocoon,

    Thank you for your post.

    I believe that AllowRemovalOfDrawObjects is what you are looking for in NinjaTrader 8:


    Please let us know if we may be of further assistance.

    Comment


      #3
      Perfect, that's it!
      Thanks so much

      Comment


        #4
        I just added this to my indicator (exactly like it is explained in the link you sent me):
        AllowRemovalOfDrawObjects = true;
        But when I try to manually remove an object drawn by my indicator, I get this message:
        This object was drawn by an indicator or strategy. Removing this object will also remove the indicator/strategy that created this object".

        I'm lost.

        Comment


          #5
          Hello laocoon,

          Thank you for your reply.

          Where in your script do you have this line?
          Code:
          AllowRemovalOfDrawObjects = true;
          If you add a print in OnBarUpdate(), for example, what value prints out for this property?
          Code:
          Print("AllowRemovealOfDrawObjects is: " + AllowRemovalOfDrawObjects);
          That print should display either true or false in the NinjaScript Output window. Based on your description, it sounds as though the property is set to false somewhere.

          Please let me know if I may be of further assistance.

          Comment


            #6
            Thanks so much Emily, I found my mistake. I had the line in the wrong place (ie at the very beginning of the code where all other variables are set to true.)
            Now I have it right below "protected override void​" and it's working.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            344 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            557 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X