Pine:策略中不能使用label.new?
在我的策略中,我想在图表上显示一些信息
//@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:
Any idea ?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,策略仅在柱收盘时计算,不会在实时柱上运行,因此标签直到 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