Pine v5 - 如何在绘图文本中制作动态文本?

Pine v5 - How to make dynamic text in plot text?

如何将输入值的动态文本制作成plotshape?谢谢

// Input
i_strat_longTPpercent  = input.float(title="Long TP(%)", defval=3) / 100

// Plot 
plotshape(longTPhit, style=shape.labeldown, location=location.abovebar, color=color.purple, size=size.tiny, title="Long TP Hit", text="Long TP" + i_strat_longTPpercent)

你不能。 text plotshape() 函数的参数需要 const string.

您可以改用 labels。

//@version=5
indicator("My script", overlay=true)

var label l = na

if (barstate.islast)
    l := label.new(bar_index, high, text="Close price: " + str.tostring(close))
    label.delete(l[1])