.netCHARTING v10.5 Documentation


dotnetCHARTING Namespace > StatisticalEngine Class > ExponentiallyWeightedMovingAverage Method : ExponentiallyWeightedMovingAverage(SeriesCollection,Double,Int32) Method
A collection of series objects. For example, to evaluate this indicator for two series you will need to pass a series collection containing this two series.
The number between 0 and 1 which is known as a smoothing factor. The closer the value is to zero the more influence more resent measurements will have on the EWMA.
The number of periods over which the moving average is evaluated for each period.
ExponentiallyWeightedMovingAverage(SeriesCollection,Double,Int32) Method
Evaluates the (x-day) Exponentially Weighted Moving Average (EWMA) of a time series provided where x is the length of the time series array which is provided as a parameter, for all periods for which sufficient data is provided.
Syntax
'Declaration
 
Public Overloads Shared Function ExponentiallyWeightedMovingAverage( _
   ByVal sc As SeriesCollection, _
   ByVal smoothingFactor As Double, _
   ByVal lengthOfMA As Integer _
) As SeriesCollection
'Usage
 
Dim sc As SeriesCollection
Dim smoothingFactor As Double
Dim lengthOfMA As Integer
Dim value As SeriesCollection
 
value = StatisticalEngine.ExponentiallyWeightedMovingAverage(sc, smoothingFactor, lengthOfMA)
public static SeriesCollection ExponentiallyWeightedMovingAverage( 
   SeriesCollection sc,
   double smoothingFactor,
   int lengthOfMA
)

Parameters

sc
A collection of series objects. For example, to evaluate this indicator for two series you will need to pass a series collection containing this two series.
smoothingFactor
The number between 0 and 1 which is known as a smoothing factor. The closer the value is to zero the more influence more resent measurements will have on the EWMA.
lengthOfMA
The number of periods over which the moving average is evaluated for each period.

Return Value

A series where the first term is the EWMA for the most recent period, the second term is the EWMA for the previous period and so on.
Exceptions
ExceptionDescription
Thrown if the Series is empty or if the value given for the smoothing factor lies outside the closed range [0,1].
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also