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

Identify selected drawing object drawn by an indicator

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

    Identify selected drawing object drawn by an indicator

    I have an indicator that draws a number of objects on the chart. There are occasion where I would like to delete one of the object without removing the indicator from the chart.

    When I click on an indicator drawn object, it gets "selected". If I double click I can see all the info on the drawing object. I am able to uncheck the visible box and the object disappears so it's no longer visible.

    But what I would like to do, is click on an object and remove it so the indicator no longer has to process the object.

    Is there a way for the indicator to "read" which draw object is selected? Read the object tag, for example?

    If so, I can add a button to my chart to remove the "selected" drawing object

    #2
    Hello cre8able,

    Thank you for your post.

    Yes, you could loop through the collection of Drawing Objects and check the drawing state of the object. If the state is DrawingState.Editing, you could call RemoveDrawingObject() on that object.

    DrawObjects - https://ninjatrader.com/support/help...rawobjects.htm

    IDrawingTool - https://ninjatrader.com/support/help...rawingtool.htm

    DrawingState - https://ninjatrader.com/support/help...awingstate.htm

    RemoveDrawObjects - https://ninjatrader.com/support/helpguides/nt8/removedrawobject.htm

    Please let us know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Great
      thank you

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Graci117, Today, 09:02 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by ETFVoyageur, Today, 07:55 PM
      0 responses
      7 views
      0 likes
      Last Post ETFVoyageur  
      Started by janio973, Today, 07:24 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by aligator, 01-06-2022, 12:14 PM
      4 responses
      247 views
      0 likes
      Last Post john_44573  
      Started by reynoldsn, Today, 05:56 PM
      0 responses
      14 views
      0 likes
      Last Post reynoldsn  
      Working...
      X