this[int index]


Summary

Gets or sets the value at the specified index.

Syntax

public double this[int index]{ get; set; }

Parameters

NameDescription

Example 1

//  The following example is the calculation of the median price
[Output("Result")]
public IndicatorDataSeries Result { get; set; }
private IndicatorDataSeries _dataSeries;
protected override void Initialize()
{
    _dataSeries = CreateDataSeries();
}
public override void Calculate(int index)
{
    
    _dataSeries[index] = (MarketSeries.High[index] + MarketSeries.Low[index])/2;
    
    // Get the value of _dataSeries at index 
    // and set the value of Result at index
    Result[index] = _dataSeries[index];
}