label.new() - Pine Script Function
label.new()
Section titled “label.new()”Overview
Section titled “Overview”Creates new label object.
Syntax
Section titled “Syntax”label.new(point, text, xloc, yloc, color, style, textcolor, size, textalign, tooltip, text_font_family, force_overlay, text_formatting) → series labelParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| point | chart.point | A chart.point object that specifies the label’s location. |
Returns
Section titled “Returns”Label ID object which may be passed to label.setXXX and label.getXXX functions.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("label.new")var label1 = label.new(bar_index, low, text="Hello, world!", style=label.style_circle)label.set_x(label1, 0)label.set_xloc(label1, time, xloc.bar_time)label.set_color(label1, color.red)label.set_size(label1, size.large)