ATan

ATan ( double value );

Description

Returns the arc tangent of an angle in the range of -pi/2 through pi/2.

Input parameters

Parameter Default value Description
value - Defines argument whose arc tangent is returned.

Example

declare lower;
input length = 3;
def avg = Average(close, length);
def height = avg - avg[length];
plot "Angle, deg" = ATan(height/length) * 180 / Double.Pi;

The code calculates the angle of slope of the simple moving average with the given length. The angle itself is calculated using the ATan function.