QuantConnect
International Future Universe
Introduction
The International Future Universe dataset by QuantConnect lists the available International Future contracts, their daily trading volume, and Open Interest. The data covers 3 contracts (FESX, HSI, and NKD), starts in July 1998, and is delivered on daily frequency. This dataset is created by monitoring the trading activity on the EUREX, HKFE, and CME.
This dataset depends on the US Futures Security Master dataset because the US Futures Security Master dataset contains information on symbol changes of the contracts.
This dataset does not
contain market data. For market data, see International Futures by TickData and US Futures by AlgoSeek for NKD.
For more information about the International Future Universe dataset, including CLI commands and pricing, see the dataset listing.
About the Provider
QuantConnect was founded in 2012 to serve quants everywhere with the best possible algorithmic trading technology. Seeking to disrupt a notoriously closed-source industry, QuantConnect takes a radically open-source approach to algorithmic trading. Through the QuantConnect web platform, more than 50,000 quants are served every month.
Getting Started
The International Futures Universe dataset provides data for contract filtering/selection:
hsi = self.add_future(Futures.Indices.HANG_SENG, Resolution.MINUTE) # "HSI" hsi.set_filter(0, 90) fesx = self.add_future(Futures.Indices.EURO_STOXX_50, Resolution.MINUTE) # "FESX" fesx.set_filter(0, 90) nkd = self.add_future(Futures.Indices.NIKKEI_225_DOLLAR, Resolution.MINUTE) # "NKD" nkd.set_filter(0, 90)
var hsi= AddFuture(Futures.Indices.HangSeng, Resolution.Minute) // "HSI"; hsi.SetFilter(0, 90); var fesx = AddFuture(Futures.Indices.EuroStoxx50, Resolution.Minute) // "FESX"; fesx.SetFilter(0, 90); var nkd = AddFuture(Futures.Indices.Nikkei225Dollar, Resolution.Minute) // "NKD"; nkd.SetFilter(0, 90);
Data Summary
The following table describes the dataset properties:
Property | Value |
---|---|
Start Date | July 1998 (for details, see Supported Assets ) |
Coverage | 3 Contracts |
Data Density | Dense |
Resolution | Daily |
Timezone | Various (for details, see Supported Assets ) |
Market Hours | Regular and Extended |
Example Applications
The International Futures Universe dataset enables you to design Futures strategies accurately. Examples include the following strategies:
- Buying the Futures contract with the most open interest to reduce slippage and market impact
- Trade speculation on an International Index
- Trading bull calendar spreads to reduce volatility and margin requirements
For more example algorithms, see Examples.
Requesting Data
To add International Future Universe data to your algorithm, call the AddFuture
add_future
method. Save a reference to the Future object so you can access the data later in your algorithm. To define which contracts should be in your universe, specify the filter when requesting the Future data.
The AddFuture
add_future
method provides a daily stream of Future chain data. To get the most recent daily chain, call the FuturesChain
futures_chain
method with the underlying Future Symbol. The FuturesChain
futures_chain
method returns data on all the tradable contracts, not just the contracts that pass your universe filter.
class InternationalFuturesDataAlgorithm(QCAlgorithm): def initialize(self) -> None: self.set_start_date(2013, 12, 20) self.set_end_date(2014, 2, 20) self.set_cash(1000000) self.universe_settings.asynchronous = True self._future = self.add_future(Futures.Indices.HANG_SENG) # Set our contract filter for this Future chain. self._future.set_filter(lambda universe: universe.standards_only().front_month()) # Get the entire Futures chain for the current day. chain = self.futures_chain(self._future.symbol, flatten=True).data_frame
public class InternationalFuturesDataAlgorithm : QCAlgorithm { private Future _future; public override void Initialize() { SetStartDate(2013, 12, 20); SetEndDate(2014, 2, 20); SetCash(1000000); UniverseSettings.Asynchronous = True; var future = AddFuture(Futures.Indices.HangSeng); // Set our contract filter for this Future chain. _future.SetFilter((universe) => universe.StandardsOnly().FrontMonth()); // Get the entire Futures chain for the current day. var chain = FuturesChain(_future.Symbol); } }
For more information about creating Future Universes, see Futures.
Accessing Data
For information about accessing International Future Universe data, see Futures.
Historical Data
You can get historical International Future Universe data in an algorithm and the Research Environment.
Historical Data In Algorithms
To get historical International Future Universe data in an algorithm, call the History
history
method with the list Future contract Symbol
objects. You may obtain all available Future contracts on a date by calling the FuturesChain
futures_chain
method. Note that this method will return all available contracts despite your previous filter. If there is no data for the period you requested, the history result is empty.
# Subscribe to the underlying Future and save a reference to the Symbol. symbol = self.add_future(Futures.Indices.HANG_SENG).symbol # Get the contracts available on this day. contracts = [x.symbol for x in self.futures_chain(symbol)] # Request the historical data to obtain the data. # DataFrame objects history_df = self.history(contracts, 10, Resolution.DAILY, flatten=True) open_interest = self.history(OpenInterest, contracts, 10, Resolution.DAILY, flatten=True) # Open Interest objects open_interest = self.history[OpenInterest](contracts, 10, Resolution.DAILY)
// Subscribe to the underlying Future and save a reference to the Symbol. var symbol = AddFuture(Futures.Indices.HangSeng).Symbol // Get the contracts available on this day. var contracts = contracts = FuturesChain(symbol).Select(x => x.Symbol).ToList(); // Request the historical data to obtain the data. // Slice objects var history = History(contracts, 10, Resolution.Daily); // Open Interest objects var openInterest = History<OpenInterest>(contracts, 10, Resolution.Daily);
For more information about historical International Future Universe data in algorithms, see History Requests.
Historical Data In Research
To get historical International Future Universe data in the Research Environment for an entire Futures chain, call the FutureHistory
future_history
method with the canonical Future Symbol
.
qb = QuantBook() future = qb.add_future(Futures.Indices.HANG_SENG) future.set_filter(0, 90) history = qb.future_history(future.symbol, datetime(2020, 6, 1), datetime(2020, 6, 5), Resolution.DAILY) history_df = history.data_frame all_history = history.get_all_data() expiries = history.get_expiry_dates()
var qb = new QuantBook(); var future = qb.AddFuture(Futures.Indices.HangSeng); future.SetFilter(0, 90); var history = qb.FutureHistory(future.Symbol, new DateTime(2020, 6, 1), new DateTime(2020, 6, 5));
You can also do similar in the research environment like in the algorithm to obtain the price and open interest data.
qb = QuantBook() end = datetime(2020, 6, 5) qb.set_start_date(end) symbol = qb.add_future(Futures.Indices.HANG_SENG).symbol # Get the contracts available on this day. contracts = [x.symbol for x in qb.futures_chain(symbol)] # Request the historical data to obtain the data. history_df = qb.history(contracts, datetime(2020, 6, 1), end, Resolution.DAILY, flatten=True) open_interest = qb.history(OpenInterest, contracts, datetime(2020, 6, 1), end, Resolution.DAILY, flatten=True)
var qb = new QuantBook(); var end = new DateTime(2020, 6, 5); qb.SetStartDate(end) var future = qb.AddFuture(Futures.Indices.HangSeng); // Get the contracts available on the day. var contracts = qb.FuturesChain(future.Symbol).Select(x => x.Symbol); // Request the historical data to obtain the data. var history = qb.History(contracts, new DateTime(2020, 6, 1), end, Resolution.Daily); var openInterest = qb.History<OpenInterest>(contracts, new DateTime(2020, 6, 1), end, Resolution.Daily);
Example Applications
The International Futures Universe dataset enables you to design Futures strategies accurately. Examples include the following strategies:
- Buying the Futures contract with the most open interest to reduce slippage and market impact
- Trade speculation on an International Index
- Trading bull calendar spreads to reduce volatility and margin requirements
For more example algorithms, see Examples.