Skip to content
Algo Trade Analytics Docs

line.get_price() - Pine Script Function

Returns the price level of a line at a given bar index.

line.get_price(id, x) → series float
NameTypeDescription
idseries lineLine object.

Price value of line ‘id’ at bar index ‘x’.

  • The line is considered to have been created using ‘extend=extend.both’.
//@version=6
indicator("GetPrice", overlay=true)
var line l = na
if bar_index == 10 l :=
line.new(0, high[5], bar_index, high)
plot(line.get_price(l, bar_index), color=color.green)