hline()在情况下带有错误消息。如何修复它?
以下代码以$ 1234的价格正确绘制一条水平线:
hline(1234, title="title", color=#ff0000, linestyle = hline.style_dotted, linewidth=1)
但是,如果我在此处定价(不要提到表达式甚至boolean?expression:na
公式),则它将带有以下错误消息返回。
hline(low, title="title", color=#ff0000, linestyle = hline.style_dotted, linewidth=1)
错误消息是:无法用参数'Price'=“低”调用'Hline'。使用了“系列float”类型的论点,但预计“输入float”
(我想在购买/上方/短信号下方绘制建议的停止损耗级别。实际上,line.new。 ()
width 扩展。除其他明显的错误之外,新的(低,扩展)
)
我对这一行有什么错?
The following code draws a horizontal line properly at $1234:
hline(1234, title="title", color=#ff0000, linestyle = hline.style_dotted, linewidth=1)
But if I put a price there (don't mention an expression or even a boolean ? expression : na
formula) then it returns with the error message below.
hline(low, title="title", color=#ff0000, linestyle = hline.style_dotted, linewidth=1)
Error message is: Cannot call 'hline' with argument 'price'='low'. An argument of 'series float' type was used but a 'input float' is expected
(I would like to draw a suggested Stop Loss level below/above buy/short signals. Actually, a line.new()
width extend.both
could be more useful but anyways, this answer should be useful for anyone facing the same case, and practically the same error happens in case of line.new(low, extend.both)
, beside other obvious errors)
What do I do wrong with this line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
hline()
期望其价格
参数在脚本执行期间不更改。这就是为什么它可以与1234
一起使用,而不是low
。行
在这种情况下,更适合您的需求。hline()
expects itsprice
parameter not to change during the script's execution. That's why it works with1234
and not withlow
.line
suits better to your needs in this case.