hline()在情况下带有错误消息。如何修复它?

发布于 2025-01-27 23:48:58 字数 548 浏览 2 评论 0原文

以下代码以$ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在你怀里撒娇 2025-02-03 23:48:58

hline()期望其价格参数在脚本执行期间不更改。这就是为什么它可以与1234一起使用,而不是low

在这种情况下,更适合您的需求。

hline() expects its price parameter not to change during the script's execution. That's why it works with 1234 and not with low.

line suits better to your needs in this case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文