Pine:策略中不能使用label.new?

发布于 2025-01-17 03:03:14 字数 382 浏览 1 评论 0原文

在我的策略中,我想在图表上显示一些信息

//@version=5
strategy("test", overlay=true, max_labels_count=500)

plot(na)

if barstate.islast
    label.new(bar_index, close, "hello")

,但什么也没有出现,正如您在此处看到的:

在此处输入图像描述

有什么想法吗?

谢谢

In my strategy, I would like to display some info on the chart

//@version=5
strategy("test", overlay=true, max_labels_count=500)

plot(na)

if barstate.islast
    label.new(bar_index, close, "hello")

But nothing appears, as you can see here:

enter image description here

Any idea ?

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

箹锭⒈辈孓 2025-01-24 03:03:14

默认情况下,策略仅在柱收盘时计算,不会在实时柱上运行,因此标签直到 4 小时柱收盘时才会出现。有多种方法可以使用 calc_on_every_tick 覆盖此设置,但这会影响您的策略的行为。

干杯,祝你有美好的一天

Strategies by default are only calculated on bar close and do not run on the real time bar, thus the label will not appear until the 4hr bar closes. There are ways to override this with calc_on_every_tick, but this will effect the behaviour of your strategy.

Cheers and have a great day

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