Sidechair

box.set_rightbottom()

Browse the reference

Moves the bottom-right corner of a box in one call, changing the right edge and the bottom edge together.

Try it in the editor

It is the usual way to stretch a box from a fixed anchor to the latest bar and the latest extreme: box.set_rightbottom(z, bar_index, math.min(low, box.get_bottom(z))).

The left and top edges are untouched. Pair it with box.set_lefttop() when both corners move.

Syntax

Pine Script
box.set_rightbottom(id: series box, right: series int, bottom: series int/float) -> void
box.set_rightbottom(right: series int, bottom: series int/float) -> void

Arguments

NameTypeDefaultDescription
idseries boxrequiredThe box whose bottom-right corner moves.
rightseries intrequiredNew right edge: a bar index, or a timestamp in milliseconds for a box that uses xloc.bar_time. na hides the box.
bottomseries int/floatrequiredNew price of the bottom edge, set together with the right edge. na hides the box until a real price is set.

Returns

Nothing.

Remarks

  • On Sidechair: while right or bottom is na the box is not drawn, and the next real pair brings it back.

Example

Pine ScriptStretch to the latest bar and lowest lowOpen in editor
//@version=6
indicator("box.set_rightbottom: stretch", overlay = true)
var box z = box.new(bar_index, high, bar_index + 1, low, bgcolor = color.new(color.navy, 88))
box.set_rightbottom(z, bar_index, math.min(low, box.get_bottom(z)))

See also

Runs on Sidechair