Category

General-Purpose Functions

Description

Round value to nearest step

Syntax

Round(value, step {1}, direction {0})

Parameters

value - formula specifying a numeric value

step - formula specifying a rounding interval (optional, defaults to 1)

direction - formula specifying a rounding direction (optional, defaults to 0)

Notes

The direction parameter is interpreted as follows:

0 means round to the nearest step, e.g. if step is 1, round UP if the decimal part of value is >= 0.5 else round down

1 means always round up

-1 means always round down

To round a calculated price to the nearest penny, use Round(price, 0.01).

Note that there is never a need to use Round in the Quantity formula. Position sizes are automatically rounded to the nearest whole share or contract.

 

 

 

Copyright © 2020-2021 Systematic Solutions, LLC