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

Alerts / Reference

alerta.alert

TradingView-compatible spelling: alert, runs without warnings

Triggers an alert event when executed. freq controls dispatch cadence: once_per_bar (default), once_per_bar_close (held until the bar closes), all (every tick). Message supports {{placeholders}}: ticker, exchange, interval, time, OHLCV, plot_N, plot("Title"), syminfo.*, strategy.order.id/action/contracts/price/comment/alert_message, strategy.market_position(_size), strategy.prev_market_position(_size).

alerta.alert(message, freq) → void

Parameters

NameTypeRequiredDefaultDescription
messagestringYes—Alert message text — {{placeholder}} tokens are substituted at fire time.
freqstringNoalert.freq_once_per_baralert.freq_once_per_bar | alert.freq_once_per_bar_close | alert.freq_all.

Returns

void

Example

alerta.alert
if crossover(close, sma(close, 20))  alert("Bullish crossover", alert.freq_once_per_bar_close)

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.