Replaces the start of a line with a chart.point, bar and price together.
A chart.point carries a bar index, a time and a price, so one value moves the start on both axes. Build it with chart.point.new(), chart.point.from_index() or chart.point.from_time().
It is the point-based counterpart of line.set_xy1(), handy when swing points are stored as chart.point values.
Syntax
line.set_first_point(id: series line, point: chart.point) -> void
line.set_first_point(point: chart.point) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series line | required | The line whose first end is replaced by the point. |
| point | chart. | required | A chart.point carrying the new index or time and the price for the first end. |
Returns
Nothing.
Example
//@version=6
indicator("line.set_first_point: anchor", overlay = true)
var line ln = line.new(bar_index, close, bar_index + 1, close)
line.set_first_point(ln, chart.point.from_index(bar_index - 10, low))See also
Runs on Sidechair