Page 1 of 1

Posted: 06 Oct 2006
I am interested in plotting Kaufman adaptive moving average
on MultiCharts.

Does any one have the TS code for this moving average ?

Posted: 06 Oct 2006
Hi ....

I take this one .... :

KAMA-Indikator
-----------------

Code: Select all

```inputs: Price( Close ), EffRatioLength( 20), FastAvgLength( 3), SlowAvgLength( 30 ); variables: MAA( 0 ) ; MAA = AdaptiveMovAvg( Price, EffRatioLength, FastAvgLength, SlowAvgLength ) ; Plot1( MAA, "MAA" ) ;```
----------------------------

Code: Select all

```inputs: Price( numericseries ), EffRatioLength( numericsimple ), FastAvgLength( numericsimple ), { this input assumed to be a constant >= 1 } SlowAvgLength( numericsimple ) ; { this input assumed to be a constant >= 1 } variables: NetChg( 0 ), TotChg( 0 ), EffRatio( 0 ), ScaledSFSqr( 0 ), SlowAvgSF( 2 / ( SlowAvgLength + 1 ) ), FastAvgSF( 2 / ( FastAvgLength + 1 ) ), SFDiff( FastAvgSF - SlowAvgSF ) ; if CurrentBar = 1 then AdaptiveMovAvg = Price else begin NetChg = AbsValue( Price - Price[ EffRatioLength ] ) ; TotChg = Summation( AbsValue( Price - Price ), EffRatioLength ) ; if TotChg > 0 then EffRatio = NetChg / TotChg else EffRatio = 0 ; ScaledSFSqr = Square( SlowAvgSF + EffRatio * SFDiff ) ; AdaptiveMovAvg = AdaptiveMovAvg + ScaledSFSqr * ( Price - AdaptiveMovAvg ) ; end ;```
Hope this is what you want.

Mike

Posted: 07 Oct 2006
Mike,

Thanks.

Posted: 07 Oct 2006
Mike,

I just checked the code for Adaptive Moving Average in MultiChart's
PowerLanguage editor. Your code looks like the same as the code
there. So you think the AMA in MultiCharts is the Kaufman AMA ?
I do not have Kaufma's book yet, so I can not verify it. I think it
should be described in Kaufman's book.