Lipi Reference
Lipi

Functions

line.set_point1()

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

Syntax

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

Arguments

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

Return Type

void

Example


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