Reference
Labels
Text notes at a price and bar.
label.copy(id)
A copy of the label.
Returns: label
| Parameter | Type |
|---|---|
id | label |
label.delete(id)
Removes the label.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
label.get_text(id)
The label's text.
Returns: text
| Parameter | Type |
|---|---|
id | label |
label.get_x(id)
The label's x.
Returns: a whole number
| Parameter | Type |
|---|---|
id | label |
label.get_y(id)
The label's y.
Returns: a number
| Parameter | Type |
|---|---|
id | label |
label.new(x, y, text="", xloc="bar_index", yloc="price", color=na, style="label_down", textcolor=na, size="normal", textalign="center", tooltip="", text_font_family="default")
Creates a label and returns its id.
Returns: label
| Parameter | Type | Notes |
|---|---|---|
x | num | |
y | num | |
text | string | Default "" |
xloc | string | Default "bar_index" |
yloc | string | Default "price" |
color | color | Default na |
style | string | Default "label_down" |
textcolor | color | Default na |
size | string | Default "normal" |
textalign | string | Default "center" |
tooltip | string | Default "" |
text_font_family | string | Default "default" |
label.set_color(id, color)
Changes the background color.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
color | color |
label.set_size(id, size)
Changes the size.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
size | string |
label.set_style(id, style)
Changes the style.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
style | string |
label.set_text(id, text)
Changes the text.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
text | string |
label.set_textalign(id, textalign)
Changes the text alignment.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
textalign | string |
label.set_textcolor(id, textcolor)
Changes the text color.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
textcolor | color |
label.set_tooltip(id, tooltip)
Changes the tooltip.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
tooltip | string |
label.set_x(id, x)
Moves the label horizontally.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
x | num |
label.set_xloc(id, x, xloc)
Changes x and how it is read.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
x | num |
xloc | string |
label.set_xy(id, x, y)
Moves the label.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
x | num |
y | num |
label.set_y(id, y)
Moves the label vertically.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
y | num |
label.set_yloc(id, yloc)
Changes how y is read.
Returns: nothing
| Parameter | Type |
|---|---|
id | label |
yloc | string |
Education only. Not financial advice. Examples are teaching samples, not trading results.
