Lipi Reference Lipi

Functions

alertcondition()

This function is used to define alert conditions in your Lipi Script that can be accessed and configured through the alert dialog (Alert Widget). It enables users to create alerts from the UI, even after the script is added to a chart, without editing the code again

Syntax

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

Arguments

condition required series bool Represents a Boolean expression or logic that determines when the alert should fire.
title const string Represents the name the alert condition.
message const string Represents the text message that will be shown or sent when the alert is triggered.

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")