math.sign() - Pine Script Function
math.sign()
Section titled “math.sign()”Overview
Section titled “Overview”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.
Syntax
Section titled “Syntax”math.sign(number) → const floatParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| number | const int/float | The number to use in the calculation. |
Returns
Section titled “Returns”The sign of the argument.