Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hiding Strategy Indicator

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

    Hiding Strategy Indicator

    I've got buttons on my strategy that show and hide various indicators. I'm using _indicator.Visible = false; to hide an indicator. This works for the indicator plots, but any Drawing objects that were created by the indicator are not hidden.

    I noticed there's an "IsAttachedToVisible" property on drawing objects, but it has no setter.

    What is the correct way to ensure that drawing objects are hidden along with the indicator that drew them?

    #2
    Hello kevinenergy,

    Thanks for your inquiry.

    Setting IsVisible on an indicator programmatically is not exactly supported (if the indicator adds an additional panel, the panel may not be removed as expected.) Noting that limitation, to accomplish your goal, I would recommend looping through the DrawObjects collection and setting the IsVisible property on all draw objects that match the DrawnBy property with the indicator you are trying to hide.

    For example:
    Code:
    foreach (DrawingTool draw in DrawObjects.ToList())
        if(draw.DrawnBy == indi) // the NinjaScript object for the indicator we want to hide
            draw.IsVisible = false;
    Please let us know if we can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    50 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    126 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    69 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    42 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X