WebCab Technical Analysis for COM v1.1

MovingAverage.ExponentiallyWeightedMovingAverage Method 

Evaluates the (x-period) 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.

public double[] ExponentiallyWeightedMovingAverage(
   double[] timeSeries,
   double smoothingFactor,
   int lengthOfMA
);

Parameters

timeSeries
An array where the first value corresponds to the value of the asset in the tth period, and the second value corresponds to the value of the asset in the t-1-th period and so on.
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 recent measurements will have on the EWMA.
lengthOfMA
The number of periods over which the moving average is evaluated for each period.

Return Value

An array 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

Exception TypeCondition
ArgumentExceptionThrown if the timeSeries is empty or if the value given for the smoothing factor lies outside the closed range [0,1].

See Also

MovingAverage Class | WebCab.COM.Finance.Trading.Indicators Namespace