AlgoSeek
US Future Options
Introduction
The US Future Options dataset by AlgoSeek provides Option data on US Future contracts, including prices, strikes, expires, implied volatility, and Greeks. The data covers 15 Monthly Future contracts, starts in January 2012, and is delivered on a minute frequency. This dataset is created by monitoring the trading activity on the CME, CBOT, NYMEX, and COMEX markets.
For more information about the US Future Options dataset, including CLI commands and pricing, see the dataset listing.
About the Provider
AlgoSeek is a leading historical intraday US market data provider offering the most comprehensive and detailed market data and analytics products in the financial industry covering equities, futures, options, cash forex, and cryptocurrencies. AlgoSeek data is built for quantitative trading and machine learning. For more information about AlgoSeek, visit algoseek.com.
Getting Started
The following snippet demonstrates how to request data from the US Future Options dataset:
from QuantConnect.DataSource import * future = self.AddFuture(Futures.Metals.Gold, Resolution.Minute) future.SetFilter(0, 90) self.AddFutureOption(future.Symbol, lambda universe: universe.Strikes(-5, +5))
using QuantConnect.DataSource; var future = AddFuture(Futures.Metals.Gold, Resolution.Minute); future.SetFilter(0, 90); AddFutureOption(future.Symbol, universe => universe.Strikes(-5, +5));
Supported Assets
The following table shows the available Future Options:
Name | |||
---|---|---|---|
Symbol | Underlying | Market | Accessor Code |
Class III Milk Futures | |||
DC | DC | CME | Futures.Dairy.ClassIIIMilk |
Crude Oil Futures | |||
LO | CL | NYMEX | Futures.Energies.CrudeOilWTI |
NY Harbor ULSD Futures | |||
OH | HO | NYMEX | Futures.Energies.HeatingOil |
Henry Hub Natural Gas Futures | |||
ON | NG | NYMEX | Futures.Energies.NaturalGas |
RBOB Gasoline Futures | |||
OB | RB | NYMEX | Futures.Energies.Gasoline |
U.S. Treasury Bond Futures | |||
OZB | ZB | CBOT | Futures.Financials.Y30TreasuryBond |
2-Year T-Note Futures | |||
OZT | ZT | CBOT | Futures.Financials.Y2TreasuryNote |
Corn Futures | |||
OZC | ZC | CBOT | Futures.Grains.Corn |
Soybean Futures | |||
OZS | ZS | CBOT | Futures.Grains.Soybeans |
Chicago SRW Wheat Futures | |||
OZW | ZW | CBOT | Futures.Grains.SRWWheat |
E-mini S&P 500 Futures | |||
ES | ES | CME | Futures.Indices.SP500EMini |
E-mini Nasdaq-100 Futures | |||
NQ | NQ | CME | Futures.Indices.NASDAQ100EMini |
Gold Futures | |||
OG | GC | COMEX | Futures.Metals.Gold |
Copper Futures | |||
HXE | HG | COMEX | Futures.Metals.Copper |
Silver Futures | |||
SO | SI | COMEX | Futures.Metals.Silver |
Data Point Attributes
The US Future Options dataset provides TradeBar, QuoteBar, and OpenInterest objects.
TradeBar Attributes
TradeBar objects have the following attributes:
QuoteBar Attributes
QuoteBar objects have the following attributes:
OpenInterest Attributes
OpenInterest objects have the following attributes:
Requesting Data
To add US Future Options data to your algorithm, call the AddFutureOption method.
class FutureOptionDataAlgorithm(QCAlgorithm): def Initialize(self) -> None: self.SetStartDate(2020, 1, 28) self.SetEndDate(2020, 6, 1) self.SetCash(100000) future = self.AddFuture(Futures.Metals.Gold, Resolution.Minute) future.SetFilter(0, 90) self.AddFutureOption(future.Symbol, lambda universe: universe.Strikes(-5, +5))
namespace QuantConnect { public class FutureOptionDataAlgorithm : QCAlgorithm { public override void Initialize() { SetStartDate(2020, 1, 28); SetEndDate(2020, 6, 1); SetCash(100000); var future = AddFuture(Futures.Metals.Gold, Resolution.Minute); future.SetFilter(0, 90); AddFutureOption(future.Symbol, universe => universe.Strikes(-5, +5)); } } }
The Future resolution must be less than or equal to the Future Option resolution. For example, if you set the Future resolution to minute, then the Future Option resolution must be minute, hour, or daily.
For more information about creating Future Options subscriptions, see Requesting Data or Future Options Universes.
Accessing Data
To get the current Future Options data, iterate through the OptionChains of the current Slice. Slice objects deliver unique events to your algorithm as they happen, but the Slice may not contain data for your Future Options at every time step.
def OnData(self, slice: Slice) -> None: for canonical_fop_symbol, chain in slice.OptionChains.items(): for contract in chain: self.Log(f"{contract.Symbol} price at {slice.Time}: {contract.LastPrice}")
public override void OnData(Slice slice) { foreach (var kvp in slice.OptionChains) { var canonicalFOPSymbol = kvp.Key; var chain = kvp.Value; foreach (var contract in chain) { Log($"{contract.Symbol} price at {slice.Time}: {contract.LastPrice}"); } } }
You can also iterate through the FuturesChains in the current Slice first.
def OnData(self, slice: Slice) -> None: for continuous_future_symbol, futures_chain in slice.FuturesChains.items(): # Select a Future Contract and create its canonical FOP Symbol futures_contract = [contract for contract in futures_chain][0] canonical_fop_symbol = Symbol.CreateCanonicalOption(futures_contract.Symbol) option_chain = slice.OptionChains.get(canonical_fop_symbol) if option_chain: for fop_contract in option_chain: self.Log(f"{fop_contract.Symbol} price at {slice.Time}: {fop_contract.LastPrice}")
public override void OnData(Slice slice) { foreach (var kvp in slice.FuturesChains) { var continuousContractSymbol = kvp.Key; var futuresChain = kvp.Value; // Select a Future Contract and create its canonical FOP Symbol var futuresContract = futuresChain.First(); var canonicalFOPSymbol = QuantConnect.Symbol.CreateCanonicalOption(futuresContract.Symbol); if (slice.OptionChains.TryGetValue(canonicalFOPSymbol, out var optionChain)) { foreach (var fopContract in optionChain) { Log($"{fopContract.Symbol} price at {slice.Time}: {fopContract.LastPrice}"); } } } }
For more information about accessing Future Options data, see Handling Data.
Historical Data
You can get historical US Future Options data in an algorithm and the Research Environment.
Historical Data In Algorithms
To get historical US Future Options data in an algorithm, call the History method with the Future Option contract Symbol. If there is no data in the period you request, the history result is empty.
# DataFrame history_df = self.History(contract.Symbol, 100, Resolution.Minute) # TradeBar objects history_trade_bars = self.History[TradeBar](contract.Symbol, 100, Resolution.Minute) # QuoteBar objects history_quote_bars = self.History[QuoteBar](contract.Symbol, 100, Resolution.Minute)
// TradeBar objects var historyTradeBars = History(contract.Symbol, 100, Resolution.Minute); // QuoteBar objects var historyQuoteBars = History<QuoteBar>(contract.Symbol, 100, Resolution.Minute);
For more information about historical data in algorithms, see History Requests.
Historical Data In Research
To get historical US Future Options data in the Research Environment for the entire Option chain of a Futures contract, call the GetOptionHistory method with the Futures contract Symbol.
qb = QuantBook() future = qb.AddFuture(Futures.Indices.SP500EMini, Resolution.Minute) future_symbols = qb.FutureChainProvider.GetFutureContractList(future.Symbol, datetime(2021, 12, 20)) future_contract_symbol = sorted(future_symbols, key=lambda s: s.ID.Date)[0] start_time = datetime(2021, 12, 1) end_time = datetime(2021, 12, 10) option_history = qb.GetOptionHistory(future_contract_symbol, start_time, end_time, Resolution.Minute) all_history = option_history.GetAllData() expiries = option_history.GetExpiryDates() strikes = option_history.GetStrikes()
var qb = new QuantBook(); var future = qb.AddFuture(Futures.Indices.SP500EMini, Resolution.Minute); var futureSymbols = qb.FutureChainProvider.GetFutureContractList(future.Symbol, new DateTime(2021, 12, 20)); var futureContractSymbol = futureSymbols.OrderBy(x => x.ID.Date).First(); var startTime = new DateTime(2021, 12, 1); var endTime = new DateTime(2021, 12, 10); var optionHistory = qb.GetOptionHistory(futureContractSymbol, startTime, endTime, Resolution.Minute); var contracts = optionHistory.SelectMany(x => x.OptionChains.SelectMany(y => y.Value.Contracts.Keys)).Distinct().ToList(); var expiries = contracts.Select(x => x.ID.Date).Distinct().ToList(); var strikes = contracts.Select(x => x.ID.StrikePrice).Distinct().ToList();
To get historical data for a single US Future Option contract, call the History method like you would in an algorithm but on the QuantBook object. For more information about historical data in the Research Environment, see Futures Options.
Example Applications
The US Future Options dataset enables you to accurately design Future Option strategies. Examples include the following strategies:
- Selling out of the money Future Option contracts to collect the premium that the Option buyer pays
- Buying put Options to hedge against downward price movement in Future contracts you bought
- Exploiting arbitrage opportunities that arise when the price of Option contracts deviate from their theoretical value