math

22 functions. Each has a page of its own.

FunctionSummary
math.absThe absolute value of number: its magnitude, with the sign removed.
math.acosThe arccosine of angle, in radians.
math.asinThe arcsine of angle, in radians.
math.atanThe arctangent of angle, in radians.
math.avgThe arithmetic mean of the numbers you pass: their sum divided by how many there are.
math.ceilThe smallest whole number that is not less than number.
math.cosThe cosine of angle, where the angle is in radians.
math.expEuler’s number raised to the power of number.
math.floorThe largest whole number that is not greater than number.
math.logThe natural logarithm of number: its logarithm to base e.
math.maxThe largest of the numbers you pass.
math.minThe smallest of the numbers you pass.
math.powbase raised to the power of exponent.
math.randomGives your script a random float, bounded below by min and above by max.
math.roundRounds number to the nearest whole number and returns an int.
math.signThe sign of number: -1 for a negative number and 1 for a positive one.
math.sinThe sine of angle, where the angle is in radians.
math.sqrtThe square root of number.
math.sumThe sum of the numbers you pass.
math.tanThe tangent of angle, where the angle is in radians.
math.todegreesConverts an angle in radians to the same angle in degrees.
math.toradiansConverts an angle in degrees to the same angle in radians.

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.
Upgrade