AlgoSeek
US Future Options
Introduction
The US Future Options dataset by AlgoSeek provides Option data on US Future contracts, including prices, strikes, and expires. The data covers 16 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.
This dataset depends on the following datasets:
- US Future Option Universe - data on the available US Future Options contracts and their current Open Interest.
- US Futures Security Master - data to construct continuous Futures.
- US Future Universe - data on the available US Future contracts, their daily trading volume, and Open Interest.
- US Futures - data on the underlying Futures contracts, including price, volume, Open Interest, and expiry.
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:
future = self.add_future(Futures.Metals.GOLD, Resolution.MINUTE) future.set_filter(0, 90) self.add_future_option(future.symbol, lambda universe: universe.strikes(-5, +5))
var future = AddFuture(Futures.Metals.Gold, Resolution.Minute); future.SetFilter(0, 90); AddFutureOption(future.Symbol, universe => universe.Strikes(-5, +5));
Data Summary
The following table describes the dataset properties:
Property | Value |
---|---|
Start Date | January 2012 |
Asset Coverage | 16 Monthly Future Contracts. Standard expires only*. |
Data Density | Dense |
Resolution | Minute, Hourly, & Daily |
Timezone | New York |
Market Hours | Regular and Extended |
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
For more example algorithms, see Examples.
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:
Supported Assets
The following list shows the available (16) Futures Options:
: Class III Milk Futures (CME: DC)Futures.Dairy.ClassIIIMilk
Futures.Dairy.CLASS_III_MILK
: Crude Oil WTI Futures (NYMEX: LO | Underlying: CL)Futures.Energy.CrudeOilWTI
Futures.Energy.CRUDE_OIL_WTI
: Gasoline RBOB Futures (NYMEX: OB | Underlying: RB)Futures.Energy.Gasoline
Futures.Energy.GASOLINE
: Heating Oil Futures (NYMEX: OH | Underlying: HO)Futures.Energy.HeatingOil
Futures.Energy.HEATING_OIL
: Natural Gas Futures (NYMEX: ON | Underlying: NG)Futures.Energy.NaturalGas
Futures.Energy.NATURAL_GAS
: 10Y U.S. Treasury Note Futures (CBOT: OZN | Underlying: ZN)Futures.Financials.Y10TreasuryNote
Futures.Financials.Y_10_TREASURY_NOTE
: 2Y U.S. Treasury Note Futures (CBOT: OZT | Underlying: ZT)Futures.Financials.Y2TreasuryNote
Futures.Financials.Y_2_TREASURY_NOTE
: 30Y U.S. Treasury Bond Futures (CBOT: OZB | Underlying: ZB)Futures.Financials.Y30TreasuryBond
Futures.Financials.Y_30_TREASURY_BOND
: Corn Futures (CBOT: OZC | Underlying: ZC)Futures.Grains.Corn
Futures.Grains.CORN
: Soybeans Futures (CBOT: OZS | Underlying: ZS)Futures.Grains.Soybeans
Futures.Grains.SOYBEANS
: Default wheat contract is SRWWheat (CBOT: OZW | Underlying: ZW)Futures.Grains.Wheat
Futures.Grains.WHEAT
: E-mini NASDAQ 100 Futures (CME: NQ)Futures.Indices.NASDAQ100EMini
Futures.Indices.NASDAQ_100_E_MINI
: E-mini S&P 500 Futures (CME: ES)Futures.Indices.SP500EMini
Futures.Indices.SP_500_E_MINI
: Copper Futures (COMEX: HXE | Underlying: HG)Futures.Metals.Copper
Futures.Metals.COPPER
: Gold Futures (COMEX: OG | Underlying: GC)Futures.Metals.Gold
Futures.Metals.GOLD
: Silver Futures (COMEX: SO | Underlying: SI)Futures.Metals.Silver
Futures.Metals.SILVER
Requesting Data
To add US Future Options data to your algorithm, call the AddFutureOption
add_future_option
method.
class FutureOptionDataAlgorithm(QCAlgorithm): def initialize(self) -> None: self.set_start_date(2020, 1, 28) self.set_end_date(2020, 6, 1) self.set_cash(100000) self.universe_settings.asynchronous = True future = self.add_future(Futures.Metals.GOLD, Resolution.MINUTE) future.set_filter(0, 90) self.add_future_option(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); UniverseSettings.Asynchronous = True; 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
option_chains
property 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 on_data(self, slice: Slice) -> None: for canonical_fop_symbol, chain in slice.option_chains.items(): for contract in chain: self.log(f"{contract.symbol} price at {slice.time}: {contract.last_price}")
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
futures_chains
in the current Slice
first.
def on_data(self, slice: Slice) -> None: for continuous_future_symbol, futures_chain in slice.futures_chains.items(): # Select a Future Contract and create its canonical FOP Symbol futures_contract = [contract for contract in futures_chain][0] canonical_fop_symbol = Symbol.create_canonical_option(futures_contract.symbol) option_chain = slice.option_chains.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.last_price}")
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
history
method with the Future Option contract Symbol
. If there is no data in the period you request, the history result is empty.
# DataFrame of trade and quote data history_df = self.history(contract.symbol, 100, Resolution.MINUTE) # DataFrame of open interest data history_oi_df = self.history(OpenInterest, 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) # OpenInterest objects history_oi = self.history[OpenInterest](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); // OpenInterest objects var historyOpenInterest = History<OpenInterest >(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, call the History
history
or OptionHistory
option_history
method. The History
history
method returns the price, volume, and open interest history for some given Future Option contract(s). The OptionHistory
option_history
method returns the price and volume history for the contracts that pass your daily universe filter.
qb = QuantBook() future = qb.add_future(Futures.Indices.SP_500_E_MINI) start_date = datetime(2024, 1, 2) future_contract_symbol = sorted( qb.future_chain_provider.get_future_contract_list(future.symbol, start_date), key=lambda s: s.id.date )[0] history = qb.option_history( future_contract_symbol, start_date, future_contract_symbol.id.date, Resolution.HOUR ) history_df = history.data_frame expiries = history.get_expiry_dates() strikes = history.get_strikes()
var qb = new QuantBook(); var future = qb.AddFuture(Futures.Indices.SP500EMini); var startDate = new DateTime(2024, 1, 2); var futureContractSymbol = qb.FutureChainProvider.GetFutureContractList(future.Symbol, startDate) .OrderBy(x => x.ID.Date) .First(); var history = qb.OptionHistory( futureContractSymbol, startDate, futureContractSymbol.ID.Date, Resolution.Hour ); var contracts = history .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 arbitrary US Equity Option contracts instead of just the that pass your universe filter, call the History
history
method like you would in an algorithm, but on the QuantBook
object. For more information about historical data in the Research Environment, see Key Concepts.
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
For more example algorithms, see Examples.