Migration guide#

This page describes what you need to do to move to v2 of the SigTech platform.

  • Access files from a single workspace per research environment

  • Install extra Python packages from a notebook or terminal

  • Use streamlined new features for deploying strategies

  • Update notebook code to use SigTech framework v9

Access files from a single workspace per research environment#

On v2 of the SigTech platform, you can only access one workspace at a time. This limitation applies whether you’re working in a research environment, or with deployed strategies.

What you need to do#

If none of your strategies use files from outside their own workspaces, you don’t need to do anything.

If your strategies do use files from other workspaces, either:

  • Rewrite your code to remove references to cross-workspace files, or

  • Add a copy of the cross-workspace file to every workspace that uses it.

About this change#

Previously, when working in a research environment (but not with deployments), you could refer to files outside of your current workspace. For example:

workspaces/
├─ workspace_a/
│  ├─ strategy.ipynb
├─ workspace_b/
│  ├─ func.py

With the file structure above, in a research environment, strategy.ipynb could run code from func.py, despite being in different workspaces.

However, when strategy.ipynb was deployed, only the files from workspace_a would be available in production, causing the deployed strategy to fail.

In v2 of the SigTech platform, when you start a research environment, only the files in the selected workspace are available. Additionally, when you deploy a strategy, a complete snapshot of the research environment is replicated in the deployment. You can be confident that your code will work the same way once deployed as it does in the research environent.

Install extra Python packages from a notebook or terminal#

On v2 of the SigTech platform, shell scripts and commands (including pip install) are no longer available when configuring your research environment before it starts. Instead, you should install any extra Python packages after the research environment has loaded.

What you need to do#

After the research environment has loaded, do one of the following:

  • In a Jupyter Notebook, use cell magic to run the pip install command:

    %pip install package-name
    
  • From the Launcher, open a new Terminal. Then, run the pip install command from the command line:

    pip install package-name
    

Avoid installing other versions of default Python packages.

To avoid package conflicts, you should avoid upgrading or downgrading any of the packages that come preinstalled in the research environment.

To see a full list of the default packages, start a new research environment and do one of the following:

  • In a Jupyter Notebook, use cell magic to run the pip list command:

    %pip list
    
  • From the Launcher, open a new Terminal. Then, run the pip list command from the command line:

    pip list
    

Use streamlined new features for deploying strategies#

Deploying a strategy is easier than ever in v2 of the SigTech platform.

When you deploy, SigTech copies the research environnent configuration to a deployment environment. All of the files and Python packages in the deployed workspace are included; however, only the code initiated by your selected entry point (a notebook file) will run. Additionally, code will only run when scheduled; not when deployed.

What you need to do#

To deploy a strategy:

  1. In the research environment, write your strategy code in a .ipynb file:

    import datetime as dtm
    import numpy as np
    import pandas as pd
    
    import sigtech.framework as sig
    
    env = sig.init()
    
    START_DATE = dtm.date(2023, 1, 1)
    END_DATE = dtm.date(2024, 1, 1)
    
    rfs = sig.RollingFutureStrategy(
        currency="USD",
        start_date=START_DATE,
        end_date=END_DATE,
        contract_code="CO",
        contract_sector="COMDTY",
        rolling_rule="front",
    )
    
  2. In the same notebook, add the following line in a code cell:

    sig.export(rfs, label="frozen orange juice futures")
    

    The line above exports the strategy’s default history output (the same output you’d get from running rfs.history_df()). You can also export other stratetgy outputs; see the documentation on Deployments for more information.

  3. Save your notebook.

  4. Select Deployments.

  5. When prompted for an entrypoint, select your notebook.

  6. Follow the prompts to set up a schedule for running your deployed code.

To view your deployments and access the results, select Deployments from the left menu bar.

Update notebook code to use SigTech framework v9#

In v2 of the SigTech platform, v8 of the SigTech framework is deprecated. By default, research environments in platform v2 use the latest v9 version of the SigTech framework.

What you need to do#

  • If you’re already using v9 of the SigTech framework, you don’t need to do anything. Any code that you move to the new platform will run the same as before.

  • If you’re using an older version of the SigTech framework (v8.*), you might need to update your code to make sure it runs in the new platform using framework v9.

To update your code for framework v9 on platform v2:

  • Remove the following legacy classes and methods from your code, if you’re using them:

    • RFPriceIndex.build_weight_df

    • fixed_cost_transaction_type

  • Update your code to replace deprecated class and method names with their v9 replacements. The following features contain classes and methods that have been renamed in v9 (v8 names are deprecated):

    • Greeks

    • Options and swaptions

    • Transaction costs

    • Utility methods

    • Some newer strategy classes

    See Introducing SigTech framework v9 for the full details.