Changes a box's outline to solid, dashed or dotted.
Pass line.style_solid, line.style_dashed or line.style_dotted, the same constants that style a line. Arrow styles belong to lines.
A dashed outline reads as a zone that is still forming or has lost its meaning, a solid one as a zone in force.
Syntax
box.set_border_style(id: series box, style: series string) -> void
box.set_border_style(style: series string) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series box | required | The box whose outline pattern changes. |
| style | series string | required | line.style_solid, line.style_dashed or line.style_dotted. Arrow styles belong to lines and do not apply to a box. |
Returns
Nothing.
Remarks
- On Sidechair: dashed draws 6 pixel dashes with 4 pixel gaps and dotted draws 2 pixel dots with 3 pixel gaps. Any other value, arrow styles included, draws solid.
Example
//@version=6
indicator("box.set_border_style: invalidated", overlay = true)
var box z = box.new(bar_index, high, bar_index + 1, low, bgcolor = color.new(color.orange, 90))
box.set_right(z, bar_index)
box.set_border_style(z, close > box.get_top(z) ? line.style_dashed : line.style_solid)See also
Runs on Sidechair