Skip to content
Algo Trade Analytics Docs

line.get_x1() - Pine Script Function

Returns UNIX time or bar index (depending on the last xloc value set) of the first point of the line.

line.get_x1(id) → series int
NameTypeDescription
idseries lineLine object.

UNIX timestamp (in milliseconds) or bar index.

//@version=6
indicator("line.get_x1")
my_line =
line.new(time, open, time + 60 * 60 * 24, close, xloc=xloc.bar_time)a = line.get_x1(my_line)
plot(time - line.get_x1(my_line)) //draws zero plot