Pagina 1 van 1

Regulariz - regularized EMAs

BerichtGeplaatst: vr 07 nov 2003, 18:42
door willie
{http://www.traders.com/Documentation/FEEDbk_docs/Archive/072003/TradersTips/TradersTips.html

Figure 1 shows three regularized exponential moving averages (EMA) compared with the standard EMA.
Note that when lambda is set to zero, the regularized EMA becomes identical to the standard EMA. In this chart, the
thick red line is the normal EMA, while the
thin white line down its middle is the regularized EMA with lambda set to zero.
The other two regularized EMAs have lambdas of 4 and 9, respectively.
?


}
{Indicator RegEMA:}

inputs:
EMA_Length( 9 ),
Lambda( 9 ) ;
variables:
RegEMA( 0 ),
Alpha( 2 / ( EMA_Length + 1 ) ) ;
if CurrentBar > 3 then
RegEMA ?= (RegEMA[1]*(1+2*Lambda) + Alpha * (C-RegEMA[1])
? ? ? ? ? - Lambda * RegEMA[2])/(1+lambda)
else
RegEMA = Close ;
Plot1( RegEMA, "RegEMA") ;