Lines

View as Markdown

Definition

A collection holding all of the Line objects that define the visualization characteristics oscillator lines of the indicator.

Property Value

A collection of Line objects.

Syntax

Lines[int index]

Examples

1protected override void OnStateChange()
2{
3 if (State == State.SetDefaults)
4 {
5 // Lines are added to the Lines collection in order
6 AddLine(Brushes.Gray, 30, "Lower"); // Stored in Lines[0]
7 AddLine(Brushes.Gray, 70, "Upper"); // Stored in Lines[1]
8 }
9}
10// Dynamically change the upper line's color and thickness based on the indicator value
11protected override void OnBarUpdate()
12{
13 if (Value[0] > 70)
14 {
15 Lines[1].Brush = Brushes.Blue;
16 Lines[1].Width = 3;
17 }
18 else
19 {
20 Lines[1].Brush = Brushes.Gray;
21 Lines[1].Width = 1;
22 }
23}