Rounding Function

Author: Optuma Team Last updated: Apr 1, 2020 05:26

Overview

The Round() function in scripting allows you to directly control the decimal places a script value outputs and works with. In the following example you can see two Show View indicators overlaid on top of each other.

Both are using an identical script, except one (yellow) has the Round() function applied, limiting the script values to 2 decimal places. You can see the effect it has with larger movements between each value, and smoother tops as the values are rounded up / down compared to the green plot.

The Round() function can be applied to any script that produces a numerical value.

Example

V1 = CLOSE() / OPEN() ;
ROUND(V1, DECIMALTYPE=0.00)