Docs

math.todegrees

Convert an angle from radians to degrees.

itm
math.todegrees(x)

An angle in radians converted to degrees: x * 180 / pi.

Parameters

A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.

NameKindTypeDefaultRangeDescription
xSeriesnumber--The value to transform.

Output

NameType
valuenumber

Warm-up and missing values

Warm-up
None.
Missing values
na in, na out. A result outside the finite range is a calculation error.

Example

itm
math.todegrees(close)
itm
plot(math.todegrees(math.atan(ta.ret(close, 1))), "Angle in degrees")