Chooses how far a line runs past its points: not at all, left, right or both.
extend.none shows only the segment. extend.right continues past the second point, extend.left before the first, and extend.both fills the pane from edge to edge along the slope.
A level that should stay visible as bars arrive needs an extension, and one that has been replaced can go back to extend.none.
Syntax
line.set_extend(id: series line, extend: series string) -> void
line.set_extend(extend: series string) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series line | required | The line whose reach past its two points changes. |
| extend | series string | required | extend.none stops at the points; extend.left, extend.right or extend.both continue the line along its slope. |
Returns
Nothing.
Remarks
- On Sidechair: a line whose two x values are equal is drawn as it is and ignores extend.
Example
//@version=6
indicator("line.set_extend: newest only", overlay = true)
ph = ta.pivothigh(high, 5, 5)
var line prev = na
if not na(ph)
line.set_extend(prev, extend.none)
prev := line.new(bar_index - 5, ph, bar_index, ph, extend = extend.right)See also
Runs on Sidechair