HPotter

Kaufman Moving Average Adaptive (KAMA)

Everyone wants a short-term, fast trading trend that works without large
losses. That combination does not exist. But it is possible to have fast
trading trends in which one must get in or out of the market quickly, but
these have the distinct disadvantage of being whipsawed by market noise
when the market is volatile in a sideways trending market. During these
periods, the trader is jumping in and out of positions with no profit-making
trend in sight. In an attempt to overcome the problem of noise and still be
able to get closer to the actual change of the trend, Kaufman developed an
indicator that adapts to market movement. This indicator, an adaptive moving
average (AMA), moves very slowly when markets are moving sideways but moves
swiftly when the markets also move swiftly, change directions or break out of
a trading range.
從喜愛的腳本中移除 添加到喜愛的腳本
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 11/07/2014
// Everyone wants a short-term, fast trading trend that works without large
// losses. That combination does not exist. But it is possible to have fast
// trading trends in which one must get in or out of the market quickly, but
// these have the distinct disadvantage of being whipsawed by market noise
// when the market is volatile in a sideways trending market. During these
// periods, the trader is jumping in and out of positions with no profit-making
// trend in sight. In an attempt to overcome the problem of noise and still be
// able to get closer to the actual change of the trend, Kaufman developed an
// indicator that adapts to market movement. This indicator, an adaptive moving
// average (AMA), moves very slowly when markets are moving sideways but moves
// swiftly when the markets also move swiftly, change directions or break out of
// a trading range.
////////////////////////////////////////////////////////////
study(title="Kaufman Moving Average Adaptive (KAMA)", shorttitle="Kaufman Moving Average Adaptive (KAMA)", overlay = true)
Length = input(21, minval=1)
xPrice = close
xvnoise = abs(xPrice - xPrice[1])
nfastend = 0.666
nslowend = 0.0645
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[1]) + nsmooth * (xPrice - nz(nAMA[1]))
plot(nAMA, color=blue, title="KAMA")
DONATE/TIP

BTC: 3FKWwtaYrf5NHZzaCi1fyAfQj7XSgtyCqe
Great Job As Usual,


Thanks A Million HPotter of the Codes

All The Best...
回覆
@ZAQDA, You are welcome
回覆
For those that want to use with pinescript v3:

nAMA = 0.0
nAMA := nz(nAMA) + nsmooth * (xPrice - nz(nAMA))
+3 回覆
HPotter hexelbyte
@hexelbyte, Thank you. It will very helpful for other.
+1 回覆
Many Thanks !
+1 回覆
HPotter Mirandole
You are welcome.
回覆
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 節目 如何運作 圖表功能 價格 網站規則 版主 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 幫助中心 推薦朋友 功能請求 部落格 & 新聞 推特
概述 個人資料設定 賬戶和賬單 推薦朋友 我的客服工單 幫助中心 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出