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 CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          51 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          32 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          99 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          177 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          170 views
          0 likes
          Last Post CarlTrading  
          Working...
          X