Changes the color of a box's outline, or removes the outline when na is passed.
Only the outline is recolored; the fill keeps its color. A stronger border on a pale fill marks the limits of a zone, while matching colors read as one solid block.
Switching the outline by condition turns a zone into a status light, for example green after a break upward and red after a break downward.
Syntax
box.set_border_color(id: series box, color: series color) -> void
box.set_border_color(color: series color) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series box | required | The box whose outline color changes. |
| color | series color | required | New outline color. na removes the outline; a border width of 0 hides it as well, whatever color is set. |
Returns
Nothing.
Remarks
- A width of 0 hides the outline whatever color is set, so check
box.set_border_width()when a recolor seems to do nothing.
Example
//@version=6
indicator("box.set_border_color: break side", overlay = true)
var box z = box.new(bar_index, high, bar_index + 1, low, bgcolor = color.new(color.gray, 90))
box.set_right(z, bar_index)
box.set_border_color(z, close > box.get_top(z) ? color.green : close < box.get_bottom(z) ? color.red : color.gray)See also
Runs on Sidechair