Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.bgcolor
On this pageSignatureParametersReturnsExample

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

Parameters

NameTypeRequiredDefaultDescription
colorseries stringYes—Color string, null for no color.
optionsobjectNot specified—{ pane, title }

Returns

void

Example

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.

AlertaScript

No results found.

Search by name, alias, or keyword.