Tradingview 单均线(MA 5-10-30-90-120-256)脚本代码

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

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

// luzhao

//@version=4

study("MA",overlay=true)

c1=sma(close,5)
c2=sma(close,10)
c3=sma(close,30)
//c4=sma(close,60)
c5=sma(close,90)
c6=sma(close,120)
c7=sma(close,256)

plot(c1,"ma5",color=#fffbe6)
plot(c2,"ma10",color=#e7bf5e)
plot(c3,"ma30",color=#81a05a)
//plot(c4,"ma60",color=#70a2a3)
plot(c5,"ma90",color=#5f809e)
plot(c6,"ma120",color=#ad77a9)
plot(c7,"ma256",color=#c87938)

//DKJ

cond=barstate.islast

moveBar=input(0)

x5=input(5)+moveBar
x10=input(10)+moveBar
x30=input(30)+moveBar
//x60=input(60)+moveBar
x90=input(90)+moveBar
x120=input(120)+moveBar
x256=input(256)+moveBar

plot(cond?low[10]:na,color=#ffda2e,linewidth=5,offset=-x10,style=plot.style_circles,transp=0)
plot(cond?low[30]:na,color=#ffda2e,linewidth=5,offset=-x30,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/348.html