math.abs() - Pine Script Function
math.abs()
Section titled “math.abs()”Overview
Section titled “Overview”Absolute value of number is number if number >= 0, or -number otherwise.
Syntax
Section titled “Syntax”math.abs(number) → const intParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| number | const int | The number to use in the calculation. |
Returns
Section titled “Returns”The absolute value of number.