Nicolas

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 Adaptive Moving Average KAMA

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: 440
Nicolas
Nicolas Legend
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

Nicolas
7 years ago
#

This moving average is the same as the Adaptive Moving Average available in the platform.

fabriziomerlo
8 years ago
#

How to use KAMA averages [10 2 30] and [10 5 30] in order to have a screener going long or short? is it possible to implement a screener based on that?

ProRealCode ProRealCode
Loading...