Sidechair

position.* constants

Browse the reference

The nine screen positions a table can take: top, middle or bottom, combined with left, center or right.

Try it in the editor

position.* constants go in the position argument of table.new, which fixes the table to a corner, an edge or the centre of the pane. They are named row first, column second: position.top_right is the top-right corner, position.middle_center the middle of the pane.

A table is anchored to the pane, not to bars, so it does not scroll with the chart.

Constants

NameValueDescription
position.bottom_centerBottom edge, horizontally centred.
position.bottom_leftBottom-left corner.
position.bottom_rightBottom-right corner.
position.middle_centerThe centre of the pane.
position.middle_leftLeft edge, vertically centred.
position.middle_rightRight edge, vertically centred.
position.top_centerTop edge, horizontally centred.
position.top_leftTop-left corner.
position.top_rightTop-right corner.

Remarks

  • Two tables can share a position; the later table.new call draws on top.

Example

Pine ScriptCorner tableOpen in editor
//@version=6
indicator("Stats table", overlay = true)
var t = table.new(position.top_right, 2, 2)
if barstate.islast
    table.cell(t, 0, 0, "Close")
    table.cell(t, 1, 0, str.tostring(close, "#.##"))
    table.cell(t, 0, 1, "Volume")
    table.cell(t, 1, 1, str.tostring(volume, "#"))
plot(close, "Close", color.gray)

See also

Runs on Sidechair