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

Drawing / Reference

alerta.fill

TradingView-compatible spelling: fill, runs without warnings

Fills the area between two plots (or two hlines). Each plot may be given by the handle plot() returns (p1 = plot(…)), by a plot() call written inline — fill(plot(a), plot(b), color = …) — or by its title. Pine v6's gradient form — fill(p1, p2, top_value, bottom_value, top_color, bottom_color) — works positionally and by name.

alerta.fill(plot1_id, plot2_id, y1?, y2?, color1?, color2?, { color, title, fillgaps, top_color, bottom_color }?) → void

Parameters

NameTypeRequiredDefaultDescription
plot1plot | stringYes—First plot: a plot handle, an inline plot() call or the plot's title.
plot2plot | stringYes—Second plot: a plot handle, an inline plot() call or the plot's title.
y1series floatNot specified—Optional top series for advanced fills.
y2series floatNot specified—Optional bottom series for advanced fills.
color1stringNot specified—Primary fill color.
color2stringNot specified—Secondary fill color.
optionsobjectNot specified—Optional settings, accepted as named arguments too: color, title, fillgaps, display, editable, and Pine v6's gradient form top_value / bottom_value / top_color / bottom_color.

Returns

void

Example

alerta.fill
basis = sma(close, 20)deviation = stdev(close, 20)upper = basis + deviationlower = basis - deviationplot(upper, { title: "up" })plot(lower, { title: "down" })fill("up", "down", { color: "rgba(0,0,255,0.1)" })

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.