yloc

Constants that control the y-axis location mode for label.new(). Determines whether a label is placed at a specific price or relative to the bar.

Constants

ConstantDescription
yloc.priceLabel is placed at the y coordinate price (default).
yloc.abovebarLabel is placed above the bar’s high, y value is ignored.
yloc.belowbarLabel is placed below the bar’s low, y value is ignored.

Example

from pynecore.lib import label, bar_index, high, yloc, script

@script.indicator(title="YLoc Demo", overlay=True)
def main():
    label.new(bar_index, high, "Above", yloc=yloc.abovebar)

Compatibility

All constants are fully supported.