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

Drawing / Reference

alerta.drawBox

TradingView-compatible spelling: box.new, runs without warnings

Draws a persistent rectangle/zone on the chart. Ideal for FVG/OB.

alerta.drawBox(id, cond, x1, y1, x2, y2, options) → void

Parameters

NameTypeRequiredDefaultDescription
idstringYes—Unique ID.
condseries boolYes—Condition.
x1intYes—Left bar_index.
y1floatYes—Top price.
x2intYes—Right bar_index.
y2floatYes—Bottom price.
optionsobjectNot specified—{ bgColor, borderColor, extend, isMitigated, mode, text }

Returns

void

Example

alerta.drawBox
isOB = bar_index > 10top = highbot = lowdrawBox("ob", isOB, bar_index - 5, top, bar_index, bot, { extend: "right", mode: "append" })

Notes

  • Legacy alias: prefer object API (`box.new` + `box.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.