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 sukhob, Today, 01:10 PM
      1 response
      13 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, 11-29-2023, 07:15 AM
      3 responses
      98 views
      0 likes
      Last Post lunardiplomacy  
      Started by ZenCortexNow, Today, 01:28 PM
      0 responses
      15 views
      0 likes
      Last Post ZenCortexNow  
      Started by MatthewLesko, 12-10-2021, 10:24 AM
      51 responses
      6,191 views
      0 likes
      Last Post brenthilburn  
      Started by AnnaM, 11-01-2022, 08:17 PM
      14 responses
      1,073 views
      0 likes
      Last Post spiketrades9  
      Working...
      X