position

The position namespace provides constants for anchoring tables to fixed screen locations. These values are passed to table.new() and table.cell() to control where a table appears on the chart.

Quick Example

from pynecore.lib import script, table, position, close, bar_index, barstate

@script.indicator(title="Price Display", overlay=True)
def main():
    t = table.new(position.top_right, 1, 2)
    if barstate.islast:
        table.cell(t, 0, 0, "Close")
        table.cell(t, 0, 1, str(close))

Constants

All constants are of type Position and represent a fixed anchor point on the chart canvas.

ConstantDescription
position.top_leftUpper-left corner of the chart
position.top_centerTop edge, horizontally centered
position.top_rightUpper-right corner of the chart
position.middle_leftLeft edge, vertically centered
position.middle_centerCenter of the chart
position.middle_rightRight edge, vertically centered
position.bottom_leftLower-left corner of the chart
position.bottom_centerBottom edge, horizontally centered
position.bottom_rightLower-right corner of the chart