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 Rapine Heihei, Today, 08:19 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    5 views
    0 likes
    Last Post Rapine Heihei  
    Started by f.saeidi, Today, 08:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 07:51 PM
    0 responses
    6 views
    0 likes
    Last Post Rapine Heihei  
    Started by frslvr, 04-11-2024, 07:26 AM
    5 responses
    98 views
    1 like
    Last Post caryc123  
    Working...
    X