Lipi Reference Lipi

Operators

>=

Greater than or equal to. Applicable to numerical expressions.

Syntax

                expr0 >= expr1
              

Example


          indicator("Close >= Moving Average", overlay=true)
// Define a 20-period simple moving average (SMA)
sma20 = ta.sma(close, 20)
// Check if the closing price is greater than or equal to the SMA
isAboveOrEqual = close >= sma20
// Plot the moving average
plot(sma20, title="20-SMA", color=color.blue)
// Change background color when the condition is met
bgcolor(isAboveOrEqual ? color.green : na)