Skip to main content

KAMA - Kaufman Adaptive Moving Average for Amibroker (AFL)

phester over 15 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    amibroker, moving average, adaptive

Kaufman Adaptive Moving Average – Uses Efficiency Ratio

Developed by Perry Kaufman, Kaufman’s Adaptive Moving Average (KAMA) is a moving average designed to account for market noise or volatility. KAMA will closely follow prices when the price swings are relatively small and the noise is low. KAMA will adjust when the price swings widen and follow prices from a greater distance. This trend-following indicator can be used to identify the overall trend, time turning points and filter price movements.

Indicator / Formula

Copy & Paste Friendly
//KAMA

LBPeriods = Param( "LB Periods", 10, 1, 200, 1 );

FSCPeriods = Param( "FSC Periods", 2, 1, 200, 1 );

SSCPeriods = Param( "SSC Periods", 30, 1, 200, 1 );

FastSmoothConst = 2 / ( FSCPeriods + 1 );

SlowSmoothConst = 2 / ( SSCPeriods + 1 );

Direction = abs( Close - Ref( Close, -LBPeriods ) );

Volatility = Sum( abs( Close - Ref( Close, -1 ) ), LBPeriods );

EfficiencyRatio = Direction / Volatility;

SC = ( EfficiencyRatio * ( FastSmoothConst - SlowSmoothConst ) + 
SlowSmoothConst ) ^ 2;

KAMA = AMA( Close, SC );

Plot( KAMA, "KAMA", ParamColor( "Color", colorYellow ), styleLine );

0 comments

Leave Comment

Please login here to leave a comment.