4

我在 ema 十字上绘制了一个标签。是否可以在标签的文本中显示收盘价?下面的代码不喜欢我尝试使用的内置“关闭”变量。

plotshape(crossover(ema1, ema2), title="Cross Over", style=shape.labelup, location=location.belowbar, color=green, size=size.normal, text=close, textcolor=white, transp=40)
4

1 回答 1

3
// mrtuanvn
//@version=4
study("Label at crossed",overlay=true)
crossed =crossover(ema(close,10), ema(close,50))
if crossed
    l = label.new(bar_index, na, tostring(close), 
         color=color.green, 
         textcolor=color.white,
         style=label.style_labeldown, yloc=yloc.abovebar)
于 2019-09-12T04:39:07.980 回答