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

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 andrewtrades, Today, 04:57 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          3 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          7 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X