math.abs
The absolute value of number: its magnitude, with the sign removed.
math.abs(const float number) → const floatmath.abs(const int number) → const intmath.abs(input float number) → input floatmath.abs(input int number) → input intmath.abs(series float number) → series floatmath.abs(series int number) → series intmath.abs(simple float number) → simple floatmath.abs(simple int number) → simple int| Parameter | Type | Required | Description |
|---|---|---|---|
number | const float | yes | The number to take the magnitude of. An int or a float is accepted. |
Returns const float or const int or input float or input int or series float or series int or simple float or simple int — The magnitude of number. An int argument gives an int and a float argument gives a float, in the argument’s own form.
indicator("Body size")
plot(math.abs(close - open))See also math.acos · math.asin · math.atan
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.