Charts 如何在扩展的TradingView Pine脚本中获取线点的值

Charts 如何在扩展的TradingView Pine脚本中获取线点的值,charts,pine-script,trading,Charts,Pine Script,Trading,我用下面的代码画了一条线: //@version=4 simplesma = sma(close, 14) var line3 = line.new(bar_index[0], high[0], bar_index, low, extend = extend.right) line.set_xy1(line3, bar_index[5], simplesma[5]) line.set_xy2(line3, bar_index[3], simplesma[3]) 这条线是用历史上的两个点绘制

我用下面的代码画了一条线:

//@version=4

simplesma = sma(close, 14)

var line3 = line.new(bar_index[0], high[0], bar_index, low, extend = extend.right)
line.set_xy1(line3, bar_index[5], simplesma[5])
line.set_xy2(line3, bar_index[3], simplesma[3])
这条线是用历史上的两个点绘制的

然后我用这个代码画一个图

price_point = line.get_price(line3,bar_index)
plot(price_point, title='Price', color=#ffcc00, transp=30)
我试图在标签上显示值,但以下代码无效:

var label3 = label.new(bar_index, high, text = "Value: "+ tostring(price_point, "#.########"), style = label.style_label_lower_left, color=#ffcc00, textcolor=#ff0000)
label.set_xy(label3,bar_index, price_point)


您能帮我把它显示在标签上吗?

变量
价格点
是当前条形图(条形图索引)上的值。您不需要使用函数
tostring()

哦,我找到了它

var label3 = label.new(bar_index, high, text = "", style = label.style_label_lower_left, color=#ffcc00, textcolor=#ff0000)
label.set_xy(label3,bar_index, price_point)
label.set_text(label3, "Value: "+ tostring(price_point, "#.########"))