RealTest User Guide
RealTest User Guide

 

 

Navigation: RealTest Script Language > Syntax Element Details >

QtyRound

 

 

 

 

Category

Strategy Elements

Description

Specifies how to round the result of the Quantity formula

Input

Any formula specifying a rounding interval (step value)

Notes

If not specified, the default rounding interval is 1 (whole shares).

QtyRound: 0 means don't do any rounding (include all available decimal places).

QtyRound: 10 means round to the next lower ten-share interval.

QtyRound: 0.1 means round to the next lower tenth-of-a-share interval.

When rounded, Quantity is always rounded down (truncated), e.g. 12.99 will be rounded to 12 if QtyRound: 1 is in use.

Quantity is rounded down by default to avoid the possibility of share rounding pushing a position value slightly over the MaxInvested threshold.

If you want to round up, or round nearest, specify QtyRound: 0 and use the Round function in your Quantity formula while keeping QtyType as Shares (the default).

Positions imported from a TradeList (including the OrderClerk trade list) are rounded only when QtyRound is explicitly specified, so that trade lists for fractional-quantity instruments (crypto, forex) play back exactly as recorded. If such a position holds a fractional quantity and you want its DynamicSizing rebalance and exit orders in whole shares, add QtyRound: 1 to the strategy.

 

 

 

Copyright © 2020-2026 Systematic Solutions, LLC