Lipi Reference Lipi

Functions

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`.

Syntax

                alertcondition(series bool condition, const string title, const string message) → void
              

Arguments

condition required series bool The condition to declare. Required, and a series bool, so it is evaluated per bar.
title const string A name for the condition. Const-form, so it cannot be built from series data. Defaults to `na`.
message const string The message the condition carries. Const-form, and fixed at compile time. Defaults to `na`.

Return Type

void

Example


          indicator("Volume > 10 Alert", overlay=false)

// Condition
volAbove10 = volume > 10

// Plotting for visual reference
plot(volume, title="Volume", color=color.blue, style=plotStyle.bar)

// Alert condition
alertcondition(volAbove10, title="Volume Greater Than 10", message="Volume has crossed above 10")