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) → voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | — | Unique ID. |
cond | series bool | Yes | — | Condition. |
x1 | int | Yes | — | Left bar_index. |
y1 | float | Yes | — | Top price. |
x2 | int | Yes | — | Right bar_index. |
y2 | float | Yes | — | Bottom price. |
options | object | Not specified | — | { bgColor, borderColor, extend, isMitigated, mode, text } |
Returns
voidExample
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.