"Developed by Perry Kaufman, Kaufman's ( ) is a moving average designed to account for market noise or . will closely follow prices when the price swings are relatively small and the noise is low. 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."
This is different from other users' KAMA's because it allows the user to adjust more parameters that can adjust the indicator in more precise ways without needing to change the source code.
study(title="Kaufman Adaptive Moving Average", shorttitle="Kaufman Adaptive Moving Average", overlay = true) Length = input(10, minval=1) xPrice = close xvnoise = abs(xPrice - xPrice) Fastend = input(4) Slowend = input(30) nfastend = 2/(Fastend + 1) nslowend = 2/(Slowend + 1) nsignal = abs(xPrice - xPrice[Length]) nnoise = sum(xvnoise, Length) nefratio = iff(nnoise != 0, nsignal / nnoise, 0) nsmooth = pow(nefratio * (nfastend - nslowend) + nslowend, 2) nAMA = nz(nAMA) + nsmooth * (xPrice - nz(nAMA)) plot(nAMA, color=blue, title="KAMA")