如何在打开 /关闭上绘制水平线(' hlines')?
我刚刚开始使用Pine-Script,并在绘制供应区域的指标时遇到了我的第一个问题。由于关闭和打开是系列类型,因此由于以下错误,我无法在Hline函数中使用它们 -
第19行:无法用参数'Price'='Call'Call'call'运算符SQBR'(系列float)调用'hline''(系列float)'。使用了“系列浮点”类型的参数,但是预期有“输入浮点”
是否可以将串联类型转换为输入类型或可以与系列类型一起绘制HLINE的替代功能的工作?
indicator("My script")
if close > open
onePercentClose = close / 100
diff = close - open
if diff > onePercentClose
hline(close[1])
hline(open[1])
I have just started working with pine-script and run into my first issue whilst working on an indicator that plots supply/demand zones. Because close and open are series types I cannot use them within the hline function due to the following error -
line 19: Cannot call 'hline' with argument 'price'='call 'operator SQBR' (series float)'. An argument of 'series float' type was used but a 'input float' is expected
Is there a work around to convert series types into input types or an alternative function that can be used with series types to plot the hlines?
indicator("My script")
if close > open
onePercentClose = close / 100
diff = close - open
if diff > onePercentClose
hline(close[1])
hline(open[1])
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
否,
hline()
无法基于串联值创建行。该值必须在编译时已知。如果要绘制水平线,则可以使用常规plot()
函数绘制图或line.new()
函数来绘制行对象。No,
hline()
cannot create lines based on series values. The value must be known at compile time. If you want to plot horizontal lines, you can use either the regularplot()
function to draw plots or theline.new()
function to draw line objects.