dotnetCHARTING Send comments on this topic.
ExponentiallyWeightedMovingAverage(String,Series,ElementValue,Double,Int32) Method
See Also 
dotnetCHARTING Namespace > FinancialEngine Class > ExponentiallyWeightedMovingAverage Method : ExponentiallyWeightedMovingAverage(String,Series,ElementValue,Double,Int32) Method


seriesName
The name of the series which will be displayed on the chart, i.e. its label.
s
A series 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.
elementValue
Specifies the particular element value (for example High, Low, Close or Open of the financial time series) which will be considered within this indicator evaluation. In particular, if you wish to use the element value high then you should pass the parameter High. In a similarly fashion if you wish to use the low, close or open, then you should pass the parameter Low, Close, Open, respectively.
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.
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

Visual Basic (Declaration) 
Public Overloads Shared Function ExponentiallyWeightedMovingAverage( _
   ByVal seriesName As String, _
   ByVal s As Series, _
   ByVal elementValue As ElementValue, _
   ByVal smoothingFactor As Double, _
   ByVal lengthOfMA As Integer _
) As Series
Visual Basic (Usage)Copy Code
Dim seriesName As String
Dim s As Series
Dim elementValue As ElementValue
Dim smoothingFactor As Double
Dim lengthOfMA As Integer
Dim value As Series
 
value = FinancialEngine.ExponentiallyWeightedMovingAverage(seriesName, s, elementValue, smoothingFactor, lengthOfMA)
C# 
public static Series ExponentiallyWeightedMovingAverage( 
   string seriesName,
   Series s,
   ElementValue elementValue,
   double smoothingFactor,
   int lengthOfMA
)

Parameters

seriesName
The name of the series which will be displayed on the chart, i.e. its label.
s
A series 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.
elementValue
Specifies the particular element value (for example High, Low, Close or Open of the financial time series) which will be considered within this indicator evaluation. In particular, if you wish to use the element value high then you should pass the parameter High. In a similarly fashion if you wish to use the low, close or open, then you should pass the parameter Low, Close, Open, respectively.
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
ArgumentExceptionThrown if the Series is empty or if the value given for the smoothing factor lies outside the closed range [0,1].

See Also

© 2010 All Rights Reserved.