我试图用颜色填充标准差之间的区域,但我得到了这个错误:
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, series[color], input integer, const string, const bool, input integer, 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)发布于 2020-09-21 16:05:34
fill()可以在两条hline或两个图之间进行填充。您的代码无法工作,因为您试图填充两个系列(hRange1和hRange2)之间的空间,而不是绘制这些系列的图。要使代码正常工作,请特别参考绘图对象,例如:
p1 = plot(hRange1,style=plot.style_stepline)
p2 = plot(hRange2,style=plot.style_stepline)
fill(p1, p2, color=color.green)https://stackoverflow.com/questions/63983962
复制相似问题