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