IndicatorDataSeries


Summary

Represents a mutable array of values. An extension of DataSeries used to represent indicator values.

Syntax

public interface IndicatorDataSeries : DataSeries

Members

NameTypeSummary
this[int index] PropertyGets or sets the value at the specified index.

Example 1

//This will be the output result of your indicator
[Output("Result", Color = Colors.Orange)]
public IndicatorDataSeries Result { get; set; }

Example 2

//  The following example is the calculation of the simple moving average 
//  of the median price
[Output("Result")]
public IndicatorDataSeries Result { get; set; }
private IndicatorDataSeries _dataSeries;
private SimpleMovingAverage _simpleMovingAverage;
protected override void Initialize()
{
    _dataSeries = CreateDataSeries();
    _simpleMovingAverage = Indicators.SimpleMovingAverage(_dataSeries, 14);
}
public override void Calculate(int index)
{
    _dataSeries[index] = (MarketSeries.High[index] + MarketSeries.Low[index])/2;
    Result[index] = _simpleMovingAverage.Result[index];
}