Pine script 如何在一次单击中启用或禁用以下指示器
如何使用此synax输入(title=“enable”,type=input.bool) 一次单击即可启用或禁用指示器 '''/@version=4 研究(title=“动态支撑与阻力”,shorttitle=“DSR”,overlay=true)Pine script 如何在一次单击中启用或禁用以下指示器,pine-script,Pine Script,如何使用此synax输入(title=“enable”,type=input.bool) 一次单击即可启用或禁用指示器 '''/@version=4 研究(title=“动态支撑与阻力”,shorttitle=“DSR”,overlay=true) //获取用户输入 emainLength=input(title=“Longterm EMA Length”,type=input.integer,deffal=200,minval=1) emaDSR1Length=input(title=“DSR
//获取用户输入
emainLength=input(title=“Longterm EMA Length”,type=input.integer,deffal=200,minval=1)
emaDSR1Length=input(title=“DSR 1 EMA Length”,type=input.integer,deffal=50,minval=1)
emaDSR2Length=input(title=“DSR 2 EMA Length”,type=input.integer,deffal=20,minval=1)
//获取EMAs
ema200=ema(闭合,emaMainLength)
ema50=ema(闭合,EMADSR1长度)
ema20=ema(闭合,EMADSR2长度)
熊市趋势=ema200>ema50和ema50>ema20//熊市趋势
牛市趋势=ema200
在选择要打印的内容时,您可以将三元数与na
一起使用。例如:
display = input(title="enable",type=input.bool, defval=true)
plot(display ? ema200 : na, color=bearTrend ? color.red : na, linewidth=2, transp=0)
display = input(title="enable",type=input.bool, defval=true)
plot(display ? ema200 : na, color=bearTrend ? color.red : na, linewidth=2, transp=0)