About US Futures Security Master
The US Futures Security Master dataset by QuantConnect provides mapping reference data for the most liquid contracts of the CME Group exchanges, calculated with popular rolling techniques. The data covers 162 root Future contracts, starts in 2012, and is delivered on a daily frequency with a zip file with all the contract mappings. This dataset is created by daily processing of the US historical Future chains.
This dataset, paired with the US Futures dataset, supports the following rolling techniques: forward panama canal, backwards panama canal, and backwards ratio. You can set the specific rolling date to occur on the last trading day, first day month, or the day when the contract with the greatest open interest changes.
VIX Futures don't support continous contract rolling with open interest.
This is not the underlying Futures data (US Futures dataset), which you need to purchase separately with a license from AlgoSeek. This security master dataset is required to purchase the US Futures or US Future Options datasets.
About QuantConnect
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.
About QuantConnect
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.
Algorithm Example
from AlgorithmImports import *
from QuantConnect.DataSource import *
class USFuturesSecurityMasterDataClassicAlgorithm (QCAlgorithm):
# 1% margin to reassure trend direction
threshold = 0.01
def initialize(self) -> None:
self.set_cash(1000000)
self.set_start_date(2019, 2, 1)
self.set_end_date(2021, 6, 1)
# Setting the continuous contract mapping criteria, the contract with highest open interest provide the best price information for trend estimation
self.continuous_contract = self.add_future(Futures.Energies.CRUDE_OIL_WTI,
data_normalization_mode = DataNormalizationMode.BACKWARDS_RATIO,
data_mapping_mode = DataMappingMode.OPEN_INTEREST,
contract_depth_offset = 0)
self.continuous_contract_symbol = self.continuous_contract.symbol
# Historical data
history = self.history(self.continuous_contract_symbol, 500, Resolution.MINUTE)
self.debug(f"We got {len(history)} items from our history request")
# Set up SMA indicator for trend direction estimator
self.sma = self.SMA(self.continuous_contract_symbol, 10, Resolution.DAILY)
# Warm up the SMA indicator for its readiness for immediate use
if not history.empty:
for time, row in history.droplevel(0).loc[self.continuous_contract_symbol].iterrows():
self.sma.update(IndicatorDataPoint(time, row.close))
def on_data(self, slice: Slice) -> None:
# Up-to-date handling of switching the mapped contract for trade liquidity
for symbol, changed_event in slice.symbol_changed_events.items():
old_symbol = changed_event.old_symbol
# Newly mapped contract might not have subscription data for trading yet, so we request its data
new_symbol = self.add_future_contract(changed_event.new_symbol).symbol
tag = f"Rollover - Symbol changed at {self.time}: {old_symbol} -> {new_symbol}"
quantity = self.portfolio[old_symbol].quantity
# Rolling over: to liquidate any position of the old mapped contract and switch to the newly mapped contract
self.liquidate(old_symbol, tag = tag)
if quantity != 0:
self.market_order(new_symbol, quantity, tag = tag)
self.log(tag)
mapped_symbol = self.continuous_contract.mapped
# Make sure trade decisions are based on newly received data
if not (slice.bars.contains_key(self.continuous_contract_symbol) and self.sma.is_ready and mapped_symbol):
return
# Buy if trend up by threshold to follow the trend
if slice.bars[self.continuous_contract_symbol].price > self.sma.current.value * (1+self.threshold) and not self.portfolio[mapped_symbol].is_long:
self.market_order(mapped_symbol, 1)
# Sell if trend down by threshold to follow the trend
elif slice.bars[self.continuous_contract_symbol].price < self.sma.current.value * (1-self.threshold) and not self.portfolio[mapped_symbol].is_short:
self.market_order(mapped_symbol, -1)
Example Applications
The US Futures Security Master enables you to design strategies harnessing continuous Futures contracts. Examples include the following strategies:
- Trading cyclical patterns in commodity Futures.
- Buying gold Futures as an inflation hedge with automatic contract roll overs.
- Detecting arbitrage opportunities between index Futures and Equities.
Pricing
Cloud Access
Use QuantConnect US Futures Security reference data in the QuantConnect Cloud for your backtesting and live trading purposes.
Download On Premise
Download US Futures Security Master reference data your LEAN backtesting and live trading on premise with the LEAN CLI. Must supply your own compatible LEAN futures market data.
Explore Other Datasets
Binance Crypto Future Margin Rate Data
Dataset by QuantConnect
US Treasury Yield Curve
Dataset by Treasury Department
Upcoming Splits
Dataset by EOD Historical Data