Pine:label.new 函数的错误

Pine: bug with the label.new function

如果您在 RUNEUSD 上执行此代码:

//@version=5
indicator("MA", "", true)

if (bar_index > 5000 and bar_index < 5800)
    label.new(bar_index, open,"", yloc = yloc.belowbar, style = label.style_none, textcolor = color.blue, size = size.normal)
    
plot(na, "Zero line", color.gray)

您会注意到条形图下方出现蓝色箭头(在条形图 5000 和 5800 之间)。

但是,如果您像这样将范围更改为 4000 和 5000:

if (bar_index > 4000 and bar_index < 5000)

根本不会出现任何栏!

我真的不明白为什么,有什么想法吗?

谢谢

它们确实出现了,但不是从索引 #4000 开始。那是因为您的图表上只能有有限数量的标签。默认值为 50。

如果你想增加 max_labels_count=500 到你的 indicator() 电话。

indicator("MA", "", true, max_labels_count=500)

您的代码:

max_labels_count=500

单独的图表绘制bar_index