Sidechair

box.get_bottom()

Browse the reference

Returns the price of the bottom edge of a box, exactly as it was last stored.

Try it in the editor

It reads the lower price that box.new() or box.set_bottom() stored. Compare it with low or close to detect a break below the zone.

Subtract it from box.get_top() for the height of the box in price units, or divide a distance by it to express that distance as a percentage of the floor.

Syntax

Pine Script
box.get_bottom(id: series box) -> series float
box.get_bottom() -> series float

Arguments

NameTypeDefaultDescription
idseries boxrequiredThe box to read the bottom price from. na gives na back.

Returns

series float: Price of the bottom edge, as it was last set.

Remarks

  • On Sidechair: calling it on na gives na, which plot() shows as a gap.

Example

Pine ScriptPlot the percent distance from the floorOpen in editor
//@version=6
indicator("box.get_bottom: percent from the floor", overlay = false)
var box z = na
if bar_index % 50 == 0
    z := box.new(bar_index, high, bar_index + 50, low, bgcolor = color.new(color.teal, 90))
plot(na(z) ? na : (close - box.get_bottom(z)) / box.get_bottom(z) * 100, "Percent from floor")

See also

Runs on Sidechair