Moves the bottom edge of a box to a new price, leaving the top edge and both sides unchanged.
Only the lower boundary changes, so lowering it deepens the box downward and raising it shrinks the box from below.
Tie it to a volatility measure such as close - 2 * ta.atr(14) for a floor that follows price, or to ta.lowest() for a plain range.
Syntax
box.set_bottom(id: series box, bottom: series int/float) -> void
box.set_bottom(bottom: series int/float) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series box | required | The box whose bottom edge moves. |
| bottom | series int/ | required | New price of the bottom edge, in the chart's price units. na hides the box until a real price is set. |
Returns
Nothing.
Remarks
- On Sidechair: a bottom set above the top is stored as given and still draws a rectangle between the two prices;
box.get_bottom()reports the stored value.
Example
//@version=6
indicator("box.set_bottom: trailing floor", overlay = true)
atr = ta.atr(14)
var box z = box.new(bar_index, high, bar_index + 1, low, bgcolor = color.new(color.blue, 88))
box.set_right(z, bar_index)
box.set_bottom(z, close - 2 * atr)See also
Runs on Sidechair