OutputDescriptor

Description

OutputDescriptor is a collection that contains the plot objects of an indicator.

When a plot object is added to an indicator using the Add() method, it is also automatically added to the "plots" collection.

The order of the add commands determines how the plots are sorted. The first Add() information request will create Plots[0], the following information request will create OutputDescriptor[1] etc.

See Lines.

Usage

OutputDescriptor[int index]

Example

protected override void OnInit()
{
    Add(new OutputDescriptor(Color.FromKnownColor(KnownColor.Blue), "MySMA 20")); // saved to OutputDescriptor[0]
}
protected override void OnCalculate()
{
Value.Set(SMA(20)[0]);
// If the market price is above the SMA colorize it green, otherwise red
if (Close[0] > SMA(20)[0])
    OutputDescriptor[0].PlotColor = Color.Green;
else
    OutputDescriptor[0].PlotColor = Color.Red;
}

Last updated