Skip to content

Rounding Function

By Optuma Team · Updated 2020-04-01

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)

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.