wma
This is a 3 time frame weighted moving average. It can help guide trades on a smaller time frame by showing larger timeframe trend.

開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
study("WMAMulti", overlay=true)

tf1 = input(title="time frame 1", defval="15")
tf2 = input(title="time frame 2", defval="30")
tf3 = input(title="time frame 3", defval="60")
length = input(title="length", defval=20)

ma1 = security(tickerid, tf1, wma(hl2, length))
ma2 = security(tickerid, tf2, wma(hl2, length))
ma3 = security(tickerid, tf3, wma(hl2, length))

getcolor (avg, tf) =>
    prev = security(tickerid, tf, wma(hl2, length)[1])
    avg >= prev ? green : red
   
plot(ma3, color=getcolor(ma3, tf3), style=line, linewidth=3)
plot(ma2, color=getcolor(ma2, tf2), style=line, linewidth=3)
plot(ma1, color=getcolor(ma1, tf1), style=line, linewidth=3)