Plots
Previous Topic  Next Topic 

Definition

A collection holding all of the Plot objects that define the visualization characterstics of the indicator.


Property Value

A collection of Plot objects.


Syntax

Plots[int index]


Examples

// Initialize method of a custom indicator
protected override void Initialize()
{
    // Plots are added to the Plots collection in order
    Add(new Plot(Color.Orange, "Plot1")); // Stored in Plots[0]
    Add(new Plot(Color.Blue, "Plot2"));   // Stored in Plots[1]
}

// Dynamically change the primary plot's color based on the indicator value
protected override void OnBarUpdate()
{
    if (Value[0] > 100)
        Plots[0].Pen = new Pen(Color.Blue);
    else
        Plots[0].Pen = new Pen(Color.Red);
}