Overload | Description |
---|---|
SimpleMovingAverage(String,Series,ElementValue,Int32) | Calculates the arithmetic(or simple) Moving Average(MA) of a given period for all possible data points (i.e. periods) for which there is sufficient historical data provided. |
SimpleMovingAverage(Series,ElementValue,Int32) | Calculates the arithmetic(or simple) Moving Average(MA) of a given period for all possible data points (i.e. periods) for which there is sufficient historical data provided. |
SimpleMovingAverage(SeriesCollection,ElementValue,Int32) | Calculates the arithmetic(or simple) Moving Average(MA) of a given period for all possible data points (i.e. periods) for which there is sufficient historical data provided. |
Exception | Description |
---|---|
ArgumentException | Thrown if the series is empty. |
Illustration
If we are considering a traded asset and the periods considered are days then by
passing an array containing the closing daily prices of a given asset, and by choosing
to use the 5-day moving average (i.e. passing a length of the MA of 5
),
then this method will evaluate the Moving Average (MA) for all days for which the closing
price on that day and the four previous days is known.