I would like to use a smoothed moving average (SMMA) in MS. Is there already a function or indicator for this?
I found the following, but I am not sure if it is correct:
Function & Indicator:
Code: Select all
//Function:
inputs:
Price( numericseries ),
Length( numericsimple ) ; { this input should be a constant >= 1 }
Vars:
SmoothingFactor( 1 / Length ), SMMA(0);
If Currentbar = 1 then
SMMA = Price
else
SMMA = SMMA[1] + SmoothingFactor * ( Price - SMMA[1] ) ;
//Indicator:
inputs:
Price(Close),
Length(13) ;
vars:
SmoothingFactor( 1 / Length ),
SMMA( Price );
SMMA= SMMA[1] + SmoothingFactor * ( Price - SMMA[1] ) ;
Plot1( SMMA, "SMMA", White ) ;[code]
Thanks a lot!