Why the label output is NaN in the following code?
//@version=5
indicator("My script")
if barstate.islast
ema = ta.ema(close, 21)
label.new(bar_index, 0, str.tostring(ema[bar_index]))
plot(close)
Why the label output is NaN in the following code?
//@version=5
indicator("My script")
if barstate.islast
ema = ta.ema(close, 21)
label.new(bar_index, 0, str.tostring(ema[bar_index]))
plot(close)