OPEN-SOURCE SCRIPT

3 - select MA

study("3 - select MA",overlay = true)
Ea = input (34,title ="Plot 1", minval = 1, maxval = 500)
Eb = input (50,title ="Plot 2", type = integer, minval = 1, maxval = 500)
Ec = input (89,title ="Plot 3", type = integer, minval = 1, maxval = 500)
Select = input(2,type = integer, minval = 1, maxval = 3, title="Moving Average Calculation: (1 = SMA), (2 = EMA), (3 = WMA)")
disa = Select == 1 ? sma(close, Ea) : Select == 2 ? ema(close, Ea) : Select == 3 ? wma(close, Ea) :na
disb = Select == 1 ? sma(close, Eb) : Select == 2 ? ema(close, Eb) : Select == 3 ? wma(close, Eb) :na
disc = Select == 1 ? sma(close, Ec) : Select == 2 ? ema(close, Ec) : Select == 3 ? wma(close, Ec) :na
plot(disa,color = green)
plot(disb,color = blue)
plot(disc,color = red)

Moving Averages

开源脚本

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

想在图表上使用此脚本?

免责声明