Lipi Reference
Lipi

Functions

line.set_point2()

Sets a line's second endpoint from a chart.point. X is taken from the point's index or time depending on the line's xloc.

Syntax

                line.set_point2(series line id, series chartPoint point) → void
              

Arguments

id required series line Line object to modify.
point required series chartPoint chart.point for the second endpoint.

Return Type

void

Example


          //@lipi=2
indicator("line.set_point2 Example", overlay=true)
if barstate.islast {
    l = line.new(bar_index[10], high[10], bar_index, high, color=color.red)
    line.set_point2(l, chartPoint.from_index(bar_index, close))
}