Drawing / Reference
alerta.bgcolor
TradingView-compatible spelling: bgcolor, runs without warnings
Changes the background color of the chart based on a condition.
alerta.bgcolor(color, options) → voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
color | series string | Yes | — | Color string, null for no color. |
options | object | Not specified | — | { pane, title } |
Returns
voidExample
alerta.bgcolor
const c = close > open ? "rgba(0, 255, 0, 0.05)" : "rgba(255, 0, 0, 0.05)"bgcolor(c, { pane: "oscillator" })Names and aliases
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.