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
ParameterTypeRequiredDescription
conditionseries boolyesThe condition to declare. Required, and a series bool, so it is evaluated per bar.
titleconst stringnoA name for the condition. Const-form, so it cannot be built from series data. Defaults to na.
messageconst stringnoThe 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.
Upgrade