Futures
This page shows how to create and work with individual future contracts on the platform.
Learn more: Rolling Future Strategy | Example notebooks
Environment
Setting up your environment takes three steps:
Import the relevant internal and external libraries
Configure the environment parameters
Initialise the environment
Learn more: Setting up the environment
Futures instrument
To pull a treasury future instrument object from our object factory:
You can then retrieve time series and static data from this object. The available time series can be retrieved by the running the below commands. The available data will differ depending on the instrument type.
To query any of the above listed time series, the.history()
method is used. The method uses the parameter fields
to declare which of the time series are retrieved. If no field
is defined, the default value is LastPrice
.
The time series can also be plotted as shown below:
Additional useful methods and properties of a futures contract object are the following:
Method/Property | Explanation |
| Exchange code for contract |
| Expiry code for contract |
| Underlying instrument |
| Contract code of instrument |
| Next contract in futures strip |
Futures group
All future contracts for a given asset are related using a futures group:
From a given futures group, all futures contracts related to the group can be queried using the following method:
Back-adjusted futures prices
You have the ability to work with back-adjusted futures series to avoid triggering spurious trading signals during the roll.
The following code block demonstrates this functionality by setting the back_adjusted
parameter to True
:
Creating strategies
To create strategies of futures contracts, use the building block RollingFutureStrategy
object.
For further information on RollingFutureStrategy
, see Rolling Future Strategy.
Last updated