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) → voidParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
message | string | Yes | — | Alert message text — {{placeholder}} tokens are substituted at fire time. |
freq | string | No | alert.freq_once_per_bar | alert.freq_once_per_bar | alert.freq_once_per_bar_close | alert.freq_all. |
Returns
voidExample
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.