Summary

Returns the sum of a dataseries, over the specified period.

Syntax

Sum(DataSeries series, int period)

Parameters

Example

SimpleMovingAverage sma;

protected override void Initialize()
{
    sma = Indicators.SimpleMovingAverage(source, period);
}

public override void Calculate(int index)
{
    Result[index] = Functions.Sum(sma.Result,20); 
    //This will output the sum of simple moving average of last 20 indexes
}