Kaufman Adaptive Moving Average KAMA

Category: Indicators By: Nicolas Created: October 26, 2015, 10:27 PM
October 26, 2015, 10:27 PM
Indicators
2 Comments

Kaufman’s Adaptive Moving Average (KAMA) was created by Perry J. Kaufman and presented in 1998 in his book “Trading Systems and Methods, 3rd Edition”. The main advantage of KAMA over other moving averages is that it takes into consideration not only the direction, but also the market volatility. KAMA adjusts its length according to the prevailing market conditions.(source: Wikipedia)

// parameters :
// Period = 10
// FastPeriod = 2
// SlowPeriod = 30

Fastest = 2 / (FastPeriod + 1)
Slowest = 2 / (SlowPeriod + 1)
if barindex < Period+1 then
Kama=close
else
Num = abs(close-close[Period])
Den = summation[Period](abs(close-close[1]))
ER = Num / Den
Alpha = SQUARE(ER *(Fastest - Slowest )+ Slowest)
KAMA = (Alpha * Close) + ((1 -Alpha)* Kama[1])
endif

return kama

 

Download
Filename: Kaufmans-Adaptive-MA-KAMA.itf
Downloads: 422
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...