alert
Raises an alert from inside your own logic, with a message you build. It is the one output-shaped function with no top-level rule, so it may be called inside a branch — which is what makes “alert me when this happens” expressible. It fires at most once per bar, only on realtime bars, and only when the script is running as an alert; on historical bars it does nothing.
alert(series string message) → void| Parameter | Type | Required | Description |
|---|---|---|---|
message | series string | yes | The message to raise. Required, and a series string, so it can differ from bar to bar. |
Returns void — void.
indicator("Session open alert")
if session.isfirst {
alert("A new session has started")
}
plot(close)See also alerts
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.