InvestitoreComune

Golden Cross KAMA

The usage is very easy. When the line is green you can open long position, when the line is red you can open short position and when it's black just check by yourself.
Usually I use it with RSI and Bollinger Bands, in order to determine when the signal is strong or weak.

Just play with fastest and slowest SC to adjust the smoothness.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//@version=2
study("Golden Cross Kaufman's Adaptive Moving Average",shorttitle="GC KAMA",overlay=true)
price=input(close)
len1=input(defval=12,minval=1,title="Fast")
len2=input(defval=26,minval=1,title="Slow")
fast=input(defval=2,minval=1,title="Fastest SC")
slow=input(defval=30,minval=1,title="Slowest SC")
fastestSC=(2/(fast+1))
slowestSC=(2/(slow+1))
change1=abs(price-price[len1])
diff1=abs(price-price[1])
volatility1=sum(diff1,len1)
ER1=change1/volatility1
SC1=pow(ER1*(fastestSC-slowestSC)+slowestSC,2)
out1=nz(out1[1])+SC1*(price-nz(out1[1]))
change2=abs(price-price[len2])
diff2=abs(price-price[1])
volatility2=sum(diff2,len2)
ER2=change2/volatility2
SC2=pow(ER2*(fastestSC-slowestSC)+slowestSC,2)
out2=nz(out2[1])+SC2*(price-nz(out2[1]))
plot(out1,color=out1>out2?(price>out1?green:black):(out1>price?red:black),title="GC KAMA",linewidth=2)