如何保留标签

问题描述 投票:0回答:1

添加第二个if后,label2出现在图表上,但label1消失了。我怎样才能保留这两个标签? 事实上,我有 3 个条件,如果按顺序满足,我想标记 1、2 和 3。我该怎么做?

if ta.crossover(fastSMA, SlowSMA) labelLong1 := label.new(bar_index, high, size=size.tiny, style=label.style_label_down, color = color.rgb(175, 168, 76), text = '1', textcolor = color.rgb(1, 0,5))

closedAbove9SMA =  close > fastSMA
if closedAbove9SMA
    labelLong2 := label.new(bar_index, high, size=size.tiny, style=label.style_label_down, color = color.rgb(175, 168, 76), text = '2', textcolor = color.rgb(1,0,5))

我是 pine 新手,上面的代码是我尝试过的。

conditional-statements label
1个回答
0
投票

我的代码实际上没有任何问题。因为我的标签重叠。 感谢 PineCoders 的 Sunil Kinra Pine 脚本问答电报聊天

© www.soinside.com 2019 - 2024. All rights reserved.