4. Multi-instrument futures strategy
Create a simple basket strategy that maintains specific weightings for different instruments.
A multi-instrument strategy in seven steps
In SigTech's Research environment, create a new notebook and run the following seven code blocks:
1. Set up environment
2. Define instruments
3. Define historical period
As you'll need to use the start and end dates multiple times, store them as variables:
4. Define a function for creating similar RollingFutureStrategy
instances
RollingFutureStrategy
instancesCreate multiple RollingFutureStrategy
instances—one for each instrument listed above. Create them using this function:
5. Build the RollingFutureStrategy
instances inside a dictionary
RollingFutureStrategy
instances inside a dictionaryBuild the RollingFutureStrategy
instances and store them inside a dictionary:
6. Build the BasketStrategy
BasketStrategy
The BasketStrategy
building block is a strategy of strategies—it is a container for managing multiple sub-strategies.
With the following code build a BasketStrategy
to manage the three RollingFutureStrategy
instances created above:
7. Run the basket strategy and view its performance
👷Your turn: customise the strategy
Add more instruments and define each instrument's weighting in the strategy.
Last updated