I am interested in plotting Kaufman adaptive moving average
on MultiCharts.
Does any one have the TS code for this moving average ?
Kaufmann adaptive moving average
Hi ....
I take this one .... :
KAMA-Indikator
-----------------
AdaptiveMovAvg-Function
----------------------------
Hope this is what you want.
Mike
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[1] ), EffRatioLength ) ;
if TotChg > 0 then
EffRatio = NetChg / TotChg
else
EffRatio = 0 ;
ScaledSFSqr = Square( SlowAvgSF + EffRatio * SFDiff ) ;
AdaptiveMovAvg = AdaptiveMovAvg[1] + ScaledSFSqr * ( Price - AdaptiveMovAvg[1] ) ;
end ;
Mike
-
- Posts: 3
- Joined: Sep 29 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.
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.