Tradingview 双均线(MA+EMA 20-60-120)脚本代码

作者:交易链
字数 852 · 预计阅读时间 3分钟
发布 2021年1月3日 · 阅读 39 · 分类


// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

// pyro88

//@version=4

study("MA+EMA",overlay=true)

e1=sma(close,20)

c1=ema(close,20)

e2=sma(close,60)

c2=ema(close,60)

e3=sma(close,120)

c3=ema(close,120)

plot(e1,"ma20",color=color.white,linewidth=1)

plot(c1,"ema20",color=#828282)

plot(e2,"ma60",color=color.red,linewidth=1)

plot(c2,"ema60",color=#8f5149)

plot(e3,"ma120",color=color.yellow,linewidth=1)

plot(c3,"ema120",color=#bb944f)

//DKJ

cond=barstate.islast

moveBar=input(0)

x20=input(20)+moveBar

x60=input(60)+moveBar

x120=input(120)+moveBar

plot(cond?low[20]:na,color=#ffda2e,linewidth=5,offset=-x20,style=plot.style_circles,transp=0)

plot(cond?low[60]:na,color=#ffda2e,linewidth=5,offset=-x60,style=plot.style_circles,transp=0)

plot(cond?low[120]:na,color=#ffda2e,linewidth=5,offset=-x120,style=plot.style_circles,transp=0)

https://naohua.net/jiaoyi/346.html