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

RemoveDrawObjects selective

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

    RemoveDrawObjects selective

    Hello,

    I have a lot of drawings from an indicator and all works fine but I need to remove them selective. I know how to remove a special drawing RemoveDrawObject("name"); or all RemoveDrawObjects();
    but I need to remove eg all lines but keep rectangles. Is this possible please?

    Thank you!
    Tony

    #2
    Hello tonynt,

    When you create the objects you could add these to different arrays. Like one array for lines, another array for rectangles..
    Then you could loop through that array and use RemoveDrawObject() to remove each item. (You would also want to remove the object from the array as well)

    Below is a public link to a 3rd party educational site on arrays and for loops.
    Create and loop over a string array. Access array Length and get elements at indexes.

    Iterate over numbers with for. Increment or decrement an index int from a start to an end value.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Radano, 06-10-2021, 01:40 AM
    20 responses
    616 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by Mizzouman1, Today, 07:35 AM
    0 responses
    6 views
    0 likes
    Last Post Mizzouman1  
    Started by i019945nj, 12-14-2023, 06:41 AM
    6 responses
    67 views
    0 likes
    Last Post i019945nj  
    Started by aa731, Today, 02:54 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by BarzTrading, Today, 07:25 AM
    0 responses
    3 views
    0 likes
    Last Post BarzTrading  
    Working...
    X