Skip to content
Algo Trade Analytics Docs

math.sign() - Pine Script Function

Sign (signum) of number is zero if number is zero, 1.0 if number is greater than zero, -1.0 if number is less than zero.

math.sign(number) → const float
NameTypeDescription
numberconst int/floatThe number to use in the calculation.

The sign of the argument.