I am adding a label on top of a bar in Pine Script. However, the label’s position changes with each new candle because the bar index changes. How can I add a label fixed to a specific index?
xlabel= label.new(bar_index[5],high, text = "TEST", color=color.lime, yloc = yloc.abovebar)
label.delete(xlabel[1])
I tried this, but it didn’t work..
xindex= chart.point.from_index(bar_index, high)
New contributor
ByCes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.