IsVisible

View as Markdown

Definition

Determines if the current NinjaScript object should be visible on the chart. When an object’s IsVisible property is set to false, the object will NOT be displayed on the chart and will not be calculated to save resources.

Strategies intentionally contain no IsVisible property.

This property should NOT be set on indicators which add a panel or own their own panel. Panel addition/removal is determined when an indicator is added/removed to a chart and is not modified through the IsVisible property.

Property Value

A bool value when true will be displayed on the chart; otherwise false; default value is true.

Syntax

IsVisible

Examples

1protected override void OnBarUpdate()
2{
3 // Loops through the DrawObjects collection via a threadsafe list copy
4 foreach (DrawingTool draw in DrawObjects.ToList())
5 {
6 // Detect all manual drawn line objects and change their visibility
7 if (draw is DrawingTools.Line && draw.IsUserDrawn)
8 {
9 draw.IsVisible = false;
10 }
11 }
12}