WebCab Technical Analysis for COM v1.1

MovingAverage.GeometricMovingAverage Method 

Calculates the Geometric Moving Average (GMA) for a given period for all possible data points (ie periods) for which there is sufficient historical data provided.

public double[] GeometricMovingAverage(
   double[] historicalValues,
   int lengthOfMovingAverage
);

Parameters

historicalValues
An array containing the historical values of the time series being considered. Where the first element gives the last historical value, the second term the previous periods value and so on.
lengthOfMovingAverage
The number of periods considered within the evaluation of the moving average of each of the periods on which it can be evaluated.

Return Value

An array where the first term corresponds to the Moving Average on the last period and the previous value is the value of the Moving average on the previous period and so on.

Remarks

Illustration

If we are considering a traded asset and the periods considered are periods then by passing an array containing the closing daily prices of a given asset, and by choosing to use the 5-period Geometric Moving Average (ie passing the length of the GMA of 5), then this method will evaluate the Geometric Moving Average (GMA) for all periods for which the closing price on that period and the four previous periods is known.

Exceptions

Exception TypeCondition
ArgumentExceptionThrown if the historicalValue array is empty.

See Also

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