label.new
Draws a text label at (x, y) and returns its handle. x is a bar index or a UTC ms time (xloc); y is a price, or ignored with yloc.abovebar / yloc.belowbar. The oldest labels are deleted past max_labels_count.
label.new(x: int/float, y: int/float, text: string = "", xloc: string = "bar_index", yloc: string = "price", color: color = color.blue, style: string = "label_down", textcolor: color = color.white, size: string = "normal", textalign: string = "center", tooltip: string = na, text_font_family: string = na, text_formatting: int = na, force_overlay: bool = false) -> label
label.new(point: @chart.point, text: string = "", xloc: string = "bar_index", yloc: string = "price", color: color = color.blue, style: string = "label_down", textcolor: color = color.white, size: string = "normal", textalign: string = "center", tooltip: string = na, text_font_family: string = na, text_formatting: int = na, force_overlay: bool = false) -> label
Parameters
xint/float: A bar index (bar_index), or a UTC ms time when the drawing uses xloc.bar_time.yint/float: A price; ignored with yloc.abovebar or yloc.belowbar.textstring: The label text (default none).xlocstring: xloc.bar_index or xloc.bar_timeylocstring: yloc.price, yloc.abovebar or yloc.belowbarcolorcolor: bubble color; na draws only the textstylestring: label.style_*textcolorcolor: Text color (default color.white).sizestring: size.*textalignstring: text.align_left, align_center or align_righttooltipstring: Accepted for compatibility; tooltips are not shown yet.text_font_familystring: Accepted for scripts from Pine and ignored: text uses the chart font.text_formattingint: Accepted for scripts from Pine and ignored: text is drawn in the regular style (no bold or italic).force_overlaybool: Accepted for scripts from Pine and ignored: drawings stay in the script pane.point@chart.point: Where the label points. A chart.point: its index (xloc.bar_index) or its time (xloc.bar_time) is x, its price is y; na gives na coordinates.
Example
label.new(bar_index, high, str.tostring(high), style=label.style_label_down)