Sidechair

box.set_top_left_point()

Browse the reference

Moves the top-left corner of a box to a position held in a chart.point.

Try it in the editor

The point supplies the bar and the price for the corner in one value. It is the point-based form of box.set_lefttop().

Pair it with box.set_bottom_right_point() to place both corners from stored points.

Syntax

Pine Script
box.set_top_left_point(id: series box, point: chart.point) -> void
box.set_top_left_point(point: chart.point) -> void

Arguments

NameTypeDefaultDescription
idseries boxrequiredThe box whose top-left corner moves.
pointchart.pointrequiredA chart.point whose index or time sets the left edge and whose price sets the top edge.

Returns

Nothing.

Example

Pine ScriptCorner from a pointOpen in editor
//@version=6
indicator("box.set_top_left_point: corner", overlay = true)
var box z = box.new(bar_index, high, bar_index + 1, low)
box.set_top_left_point(z, chart.point.from_index(bar_index - 10, high))

See also

Runs on Sidechair