简体   繁体   English

松脚本中的自定义输入

[英]Custom Inputs in pine-script

How to let user change the value of the avg and pbv in the script settings interface?如何让用户在脚本设置界面改变avg和pbv的值?

indicator("myindicator")
avg = ta.sma(volume, 3)
pbv = (volume > avg*1.3)
plotshape(pbv, "R", shape.triangleup, location.abovebar, color.purple)

avg and pbv are results of some calculations. avgpbv是一些计算的结果。 The user cannot change their values directly.用户不能直接更改它们的值。

What they can do is, change the sma length and that 1.3 multiplier.他们可以做的是,更改sma长度和1.3乘数。 So they can change those variables indirectly.所以他们可以间接地改变这些变量。

indicator("myindicator")
length = input.int(3, "Length")
mult = input.float(1.3, "Multiplier", step=0.1)

avg = ta.sma(volume, length)
pbv = (volume > avg * mult)
plotshape(pbv, "R", shape.triangleup, location.abovebar, color.purple)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM