Replaces the end of a line with a chart.point, bar and price together.
The point supplies the bar and the price at once, standing in for a line.set_xy2() call. It suits code that keeps swing points as chart.point values and draws between them.
Create the point with chart.point.now() for the current bar or with chart.point.from_time() for a timestamp.
Syntax
line.set_second_point(id: series line, point: chart.point) -> void
line.set_second_point(point: chart.point) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series line | required | The line whose second end is replaced by the point. |
| point | chart. | required | A chart.point carrying the new index or time and the price for the second end. |
Returns
Nothing.
Example
//@version=6
indicator("line.set_second_point: track now", overlay = true)
var line ln = line.new(bar_index, close, bar_index + 1, close)
line.set_second_point(ln, chart.point.now(close))See also
Runs on Sidechair