Stretches a box to the left edge, the right edge or both edges of the chart pane, or switches the stretch off.
extend.right carries the box to the right of the chart, extend.left to the left, extend.both across the whole width, and extend.none keeps the stored edges.
The stored left and right values do not change, so box.get_right() still reports where the zone ends. Extend suits a level that stays valid; box.set_right() suits a zone that should end.
Syntax
box.set_extend(id: series box, extend: series string) -> void
box.set_extend(extend: series string) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series box | required | The box whose horizontal stretch changes. |
| extend | series string | required | extend.none (default) keeps the stored edges; extend.left, extend.right or extend.both stretch the box to the pane edge on that side. |
Returns
Nothing.
Remarks
- On Sidechair: the stretch is applied when the box is drawn, and the text stays centred on the stretched rectangle. na or an unknown value turns the stretch off.
Example
//@version=6
indicator("box.set_extend: extend right", overlay = true)
var box z = box.new(bar_index, high, bar_index + 5, low, bgcolor = color.new(color.red, 88))
box.set_extend(z, extend.right)See also
Runs on Sidechair