Lipi Reference Lipi

Types

bool

Keyword used to explicitly declare the "bool" (boolean) type of a variable or a parameter. "bool" variables can have values true, false or na.

Example


          indicator("Bool Keyword Example", overlay=true)
// Calculate 50-period simple moving average (SMA)
sma50 = ta.sma(close, 50)
// Declare a boolean variable using `bool` keyword
bool isAboveSMA = close > sma50
// Plot a signal dot when the condition is true
plotshape(isAboveSMA, location=location.belowbar, color=color.green, shape=shape.circle, size=size.small, title="Above SMA")