This page shows the platform's functionality to investigate the impact of rounding off orders on the strategy performance.
Orders have a minimum size and can often only be traded in discrete units. By default, the platform simulation allows fractional units, with rounding applied when trades are exported. This allows strategies to be analysed and compared without consideration for the capital allocated to them.
The platform has additional functionality to see the impact that size has, or run the simulation with the discrete sizes enforced.
import sigtech.framework as sigfrom sigtech.framework.instruments.bonds import GovernmentBondimport datetime as dtmimport pandas as pdimport pytzimport seaborn as snssns.set(rc={'figure.figsize': (18, 6)})ifnot sig.config.is_initialised(): sig.config.init() sig.config.set(sig.config.FORCE_ORDER_ROUNDING, True)
Unit rounding definitions
The tradable sizes for each instrument vary and are defined on the instrument classes.
An example for government bonds:
GovernmentBond.rounded_units??
Signature: GovernmentBond.rounded_units(self, units, dt, to_trade=True)
Source:
def rounded_units(self, units, dt, to_trade=True):
"""Round bond face values to multiples of 1000"""
return self.positions_to_units(int(self.units_to_positions(units, dt) / 1000), dt) * 1000
File: ~/code/framework/sigtech/framework/instruments/bonds.py
Type: function
If required these settings can be adjusted. An example for adjusting this is given in the code below.
from sigtech.framework.instruments.bonds import GovernmentBond
def rounded_units(self, units, dt, to_trade=True):
"""Round bond face values to multiples of 10000"""
return self.positions_to_units(int(self.units_to_positions(units, dt) / 10000), dt) * 10000
GovernmentBond.rounded_units = rounded_units
Large AUM strategy example
To observe the impact of this flag we can create a simple basket of two rolling future strategies. Each of the rolling futures strategies are initialised with an AUM of 1m USD and the basket has 10m USD:
If the size of the basket is reduced to 100,000 USD, it is now too small to support the holdings of the rolling future strategies and no positions are held: