Skip to content

Absolute Value Function - ABS()

By Optuma Team · Updated 2018-10-25

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 ROC
V1 = ABS(ROC(BARS=1));
//Calculate the moving average of variable V1
MA(V1, CALC=Close, BARS=5)

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.