如何解决如何填写Pine Script?
我正在尝试用颜色填充标准差之间的区域,但出现此错误:
line 24: Cannot call 'fill' with arguments (series[float],series[float],color=const color); available overloads: fill(hline,hline,series[color],input integer,const string,const bool,string) => void; fill(plot,plot,string) => void
我尝试了设置值和变量图的各种组合,但无法弄清楚我做错了什么。任何帮助表示赞赏。
//@version=4
study("My Script",overlay = true
hRange1 = close + stdev(close,5)
hRange2 = close + (stdev(close,5)*2)
hRange3 = close + (stdev(close,5)*3)
lRange1 = close - stdev(close,5)
lRange2 = close - (stdev(close,5)*2)
lRange3 = close - (stdev(close,5)*3)
plot(hRange1,style=plot.style_stepline)
plot(hRange2,style=plot.style_stepline)
plot(hRange3,style=plot.style_stepline)
plot(lRange1,style=plot.style_stepline)
plot(lRange2,style=plot.style_stepline)
plot(lRange3,style=plot.style_stepline)
fill(hRange1,hRange2,color=color.green)
解决方法
fill()可以在两个线或两个图之间填充。您的代码无效,因为您试图填充两个系列(hRange1和hRange2)之间的空间,而不是绘制这些系列的绘图。为了使您的代码正常工作,请具体参考打印对象,例如:
p1 = plot(hRange1,style=plot.style_stepline)
p2 = plot(hRange2,style=plot.style_stepline)
fill(p1,p2,color=color.green)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。