Returns the price of the top edge of a box, exactly as it was last stored.
It reads the upper price that box.new() or box.set_top() stored. Compare it with high or close to detect a break above the zone.
A box built with its prices the other way round reports them as given: get_top() returns whatever was passed as top, even when it sits below the bottom.
Syntax
box.get_top(id: series box) -> series float
box.get_top() -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series box | required | The box to read the top price from. na gives na back. |
Returns
series float: Price of the top edge, as it was last set.
Remarks
- On Sidechair: with na or another drawing type as id, the result is na.
Example
//@version=6
indicator("box.get_top: breakout", overlay = true)
var box z = box.new(bar_index, high, bar_index + 1, low)
box.set_right(z, bar_index)
plotshape(close > box.get_top(z), "Breakout", shape.triangleup, location.belowbar, color.green)See also
Runs on Sidechair