Syntax
public SMMA(DataSeries ds, int period, string description)
public static SMMA Series(DataSeries ds, int period)
Parameter Description
ds |
Data series |
period |
Indicator lookback period |
Description
A Smoothed Moving Average is sort of a blend between a Simple Moving Average and an Exponential Moving Average, only with a longer period applied (approximately, half the EMA period: e.g. a 20-period SMMA is almost equal to a 40-period EMA).
Calculation
The first value of this smoothed moving average is calculated as the simple moving average (SMA) with the same period. The second and succeeding moving averages are calculated according to this formula:
PREVSUM = SMMA(i-1) *N
SMMA(i) = (PREVSUM-SMMA(i-1)+CLOSE(i))/N
Where:
SUM1 — is the total sum of closing prices for N periods;
PREVSUM — is the smoothed sum of the previous bar;
SMMA1 — is the smoothed moving average of the first bar;
SMMA(i) — is the smoothed moving average of the current bar (except for the first one);
CLOSE(i) — is the current closing price;
N — is the smoothing period.
Reference
Example
No example currently available.