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

Lines not deleting properly

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

    Lines not deleting properly

    Hello, I have an indicator that is doing analysis of user drawn lines. After the user deletes a line, the code can still "see" the line, even though it is deleted. Is there something that I can do to purge these semi-deleted lines?

    For example, if I run this, it will list lines that are not longer there!

    foreach(IDrawObject draw in DrawObjects)
    {
    if (draw.DrawType == DrawType.Line) {
    Print("Line: " + draw.Tag);
    }
    }

    Running RemoveDrawObjects() doesn't fix this, but I suppose that's to be expected, since the code cannot delete user created lines, correct?

    Thanks!
    Daniel

    #2
    Hi Daniel, that's unfortunately expected for the reason you stated and also there would not be an event for a drawing object change that would be needed here - this is on development's feature list for future consideration.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Daniel, that's unfortunately expected for the reason you stated and also there would not be an event for a drawing object change that would be needed here - this is on development's feature list for future consideration.
      Thank you for the response. I'm a little confused on why it's expected. If I'm initiating a built in functionality of NinjaTrader it should be using it's built-in events to handle the creation and deletion of that object, correct? I'm not overriding those.

      Yes, definitely having event handlers for drawing objects changing, deleting, etc would be greatly appreciated! RemoveComplete and InsertComplete are both called very often, so I have to use work arounds to make them useful.

      Daniel

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      32 views
      0 likes
      Last Post Pattontje  
      Started by abdo22, Yesterday, 03:15 PM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by f.saeidi, Yesterday, 02:09 PM
      3 responses
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Jltarrau, Today, 05:57 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by kujista, Today, 06:23 AM
      0 responses
      2 views
      0 likes
      Last Post kujista
      by kujista
       
      Working...
      X