如何避免重复标注?

How to avoid repeating labels?

plotshape(ema50>ema200:na, title = "50x200", location = location.belowbar,text= "50x200", textcolor=color.white,style = shape.labelup, color =color.green, size = size.small)

它一直显示标签只要 50>200 ,但我只想要标签一次。我不想使用 crossover 或 crossunder。 谢谢

下面的脚本代表了您的要求..

//@version=4
study("My Script", overlay = true)
ema50 = ema(close,50)
ema200 = ema(close,200)
Cond1 = ema50>ema200    
plotshape(Cond1 and Cond1!=Cond1[1], title = "50x200", location = location.belowbar,text= "50x200", textcolor=color.white,style = shape.labelup, color =color.green, size = size.small)
plot(ema50, title = "EMA 50")
plot(ema200, color = color.new(color.red,10), title = "EMA 200")