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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          160 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          307 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          244 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          348 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          178 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X