Environment setup
This tutorial provides a guide to to the construction of the research environment within the SigTech platform. I also covers some of the most popular configurations available.
Framework import
The SigTech framework library holds a wealth of functionality, much of which can be accessed using the following import statement:
Environment initialization
Following the importation of the sigtech.framework
library, it is necessary to initialize the environment. Initialization is performed with the command sig.init()
.
The following example demonstrates the importation of several Python libraries followed by the initialization process:
The script %pip list
lists all existing packages with corresponding version numbers. Learn more about the range of python packages available and the installation process, here.
Configuration parameters
The following parameters can be used during environment initialization:
Parameter | Default | Description |
|
| A Python date, datetime or string, for example |
|
| A Python date, datetime or string, for example |
|
| The log level determines the type of log message to display and the granularity of information to provide the user. |
After the initialization of the environment, several additional configurations can be made.
In the following code block, FORCE_OFFSETTING_OTC_TRADES
and TM_TIMEZONE
have been included:
The following parameters can be used to further configure the environment:
Parameter | Default value | Explanation |
|
| Determines whether to use calendars to build the history schedule of instruments. |
|
| Determines whether to provide values for missing data points. If |
|
| Determines whether to ignore transaction costs when running strategies. |
|
| Determines whether to treat all orders individually by disabling transaction cost netting. |
|
| Sets number of days before gathering data following a corporate action. |
|
| Determines whether to ignore corporate actions with no adjustment factor or resulting stock symbol. |
|
| Sets trading manager calendar. |
|
| Sets trading manager timezone. |
|
| Sets trading manager opening time. |
|
| Sets trading manager closing time. |
|
| Sets data point defaults according to Trading Manager Calendar. |
|
| Determines valuation when intraday data is available. If |
|
| Sets list of data points to prioritize over others. |
T | { | Facilitates overriding of transaction cost values. |
|
| Determines whether to warn user if default transaction costs are used. |
F |
| Determines discounting instrument to be used for base currency discounting in FX forwards. Can be curve of overnight index. |
|
| Sets base currency to use in FX forward market. |
|
| Sets order of the spline interpolation used by the point based FX forward market. |
|
| Determines whether to force the rounding of all units for strategy generated orders. |
| F | Determines whether to force entry into offsetting trades for FX forwards and other initial zero-value trades when trading out of them. |
|
| Override dividend tax for equity groups. |
|
| Configure data providers. List of pairs: regex matching instrument names, |
|
| Dict of splits occurring in futures groups to consider when constructing rolling future strategies. |
|
| Sets a date before which no history for any instrument will be returned. |
|
| Determines whether to restrict time series data retrieval to a specified data provider. |
|
| Sets time between the decision and execution of an FX Spot transaction. |
|
| Trades FX pairs directly, as opposed to triangulating through USD. |
Note: to destroy your configured environment and clear the cache in preparation for initializing a new environment, use sig.de_init()
.
Initialisation arguments
Attempts to initialise an already initialised environment will produce different behaviours based on the value of repeat_mode
:
'
reinit'
- Destroys the current environment and creates a new one. A warning message explaining these actions is printed'error'
- The execution terminates and a clearer error message is printed'warning'
- A warning is printed and the init() has no effect (default)
These behaviours are described in the code block below:
Last updated