Sidechair

box.set_border_style()

Browse the reference

Changes a box's outline to solid, dashed or dotted.

Try it in the editor

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

Pine Script
box.set_border_style(id: series box, style: series string) -> void
box.set_border_style(style: series string) -> void

Arguments

NameTypeDefaultDescription
idseries boxrequiredThe box whose outline pattern changes.
styleseries stringrequiredline.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

Pine ScriptDashed once price leavesOpen in editor
//@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