Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.drawLabel
On this pageSignatureParametersReturnsExampleNotes

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) → void

Parameters

NameTypeRequiredDefaultDescription
idstringYes—Unique ID per element (use mode "append" or "replace").
condseries boolYes—Condition to draw the label on current bar.
xintYes—Bar index (e.g. bar_index).
yfloatYes—Price level.
textstringYes—Text to display in the label.
optionsobjectNot specified—{ location, style, color, textColor, size, mode }

Returns

void

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.