alertcondition
Declares a condition the platform can offer to the reader. It raises nothing by itself.
Unlike alert, it must be called at the top level, and its title and message are const-form — fixed when the script is compiled. Left out, both read na.
alertcondition(series bool condition, const string title, const string message) → void| Parameter | Type | Required | Description |
|---|---|---|---|
condition | series bool | yes | The condition to declare. Required, and a series bool, so it is evaluated per bar. |
title | const string | no | A name for the condition. Const-form, so it cannot be built from series data. Defaults to na. |
message | const string | no | The message the condition carries. Const-form, and fixed at compile time. Defaults to na. |
Returns void — void.
indicator("Session open condition")
alertcondition(session.isfirst, "New session", "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.