Lipi Reference Lipi

Types

bool

A true-or-false value. The two constants `true` and `false` are the literals for it. Comparisons produce one, and the marker functions take one as their condition. No fields.

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