- Desktop
- Scripting
- Formulas and Scripting Functions
- Absolute Value Function - ABS()
Absolute Value Function - ABS()
To change negative values to positive use the ABS() function. This example calculates the 5 day average of the absolute value of the daily rate-of-change:
//Calculate the absolute value of the daily ROCV1 = ABS(ROC(BARS=1));
//Calculate the moving average of variable V1MA(V1, CALC=Close, BARS=5)Your privacy choices
We use cookies and similar technologies to make the site work, see how it's used, and improve it. Analytics and advertising cookies only run with your consent — see our Privacy Policy for details.