Drawing / Reference
alerta.drawLabel
TradingView-compatible spelling: label.new, runs without warnings
Draws a persistent label element on the chart at specific coordinates.
alerta.drawLabel(id, cond, x, y, text, options) → voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Unique ID per element (use mode "append" or "replace"). |
cond | series bool | Yes | — | Condition to draw the label on current bar. |
x | int | Yes | — | Bar index (e.g. bar_index). |
y | float | Yes | — | Price level. |
text | string | Yes | — | Text to display in the label. |
options | object | Not specified | — | { location, style, color, textColor, size, mode } |
Returns
voidExample
alerta.drawLabel
drawLabel("LL", true, bar_index, low, "LL", { style: "label_up", color: "transparent", textColor: "white", mode: "append" })Notes
- Legacy alias: prefer object API (`label.new` + `label.set_*`) for Pine parity.
Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.