Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delete drawing objects

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

    Delete drawing objects

    Greetings,
    I'm developing one indicator that draws lines, arrows and other objects. But I need to delete one or two of them in runtime.

    Is there any function or method for deleting of drawing objects ?

    Thanks very much.

    #2
    Ops. Sorry for the post.

    RemoveDrawObject();

    (I was searching in Help for "delete" and I didn't find nothing)

    Comment


      #3
      Having trouble with RemoveDrawObject()

      Hello.

      I trying to setup code that will delete an object on the previous bar, if an object is drawn on the current bar.

      Variables:
      private string tagID;
      private int prevCB;

      ..
      DrawArrowDown(CurrentBar.ToString() + "Sell", 1, ff1 + TickSize, Color.Red);

      ..
      prevCB = CurrentBar - 1;
      tagID = prevCB.ToString();
      RemoveDrawObject(tagID);

      In the 'output' window, I see ..

      Current Bar = 1614
      Current Bar.ToString() = 1614
      prevCB = 1613
      tagID = 1613

      But on the chart, its not removing the previous object. Can you see where I'm going wrong?

      Regards,
      R. C.

      Comment


        #4
        Hi R.C.,

        The reason is because your object's tags are not only CurrentBar. They are CurrentBar + "Sell".

        You need to pass in a string that would be 1613Sell for it to find your object.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks

          hi Josh,

          Thanks, that did the trick!

          Regards,
          R. C.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          607 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          353 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          560 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          561 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X