book
Checkout our new book! Hands on AI Trading with Python, QuantConnect, and AWS Learn More arrow

QuantConnect

US Future Universe

Introduction

The US Future Universe dataset by QuantConnect lists the available US Future contracts, their daily trading volume, and Open Interest. The data covers the 162 most liquid contracts, starts in May 2009, and is delivered on daily frequency. This dataset is created by monitoring the trading activity on the CFE, CBOT, CME, COMEX, NYMEX, and ICE*.

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 US Futures by AlgoSeek.

For more information about the US 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 following snippet demonstrates how to request data from the US Future Universe dataset:

future = self.add_future(Futures.Metals.GOLD)
future.set_filter(0, 90)
var future = AddFuture(Futures.Metals.Gold);
future.SetFilter(0, 90);

Data Summary

The following table describes the dataset properties:

PropertyValue
Start DateMay 2009
Asset Coverage162 Futures
Data DensityDense
ResolutionDaily
Timezone
  • Chicago (CFE, CME or CBOT)
  • New York (ICE, NYMEX or COMEX)
Market HoursRegular and Extended

Requesting Data

To add US Future Universe data to your algorithm, call the AddFutureadd_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 AddFutureadd_future method provides a daily stream of Future chain data. To get the most recent daily chain, call the FuturesChainfutures_chain method with the underlying Future Symbol. The FuturesChainfutures_chain method returns data on all the tradable contracts, not just the contracts that pass your universe filter.

class USFutureDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2020, 6, 1)
        self.set_end_date(2021, 6, 1)
        self.set_cash(100000)
        self.universe_settings.asynchronous = True
        self._future = self.add_future(Futures.Metals.GOLD)
        # 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 USFutureDataAlgorithm : QCAlgorithm
{
    private Future _future;
        
    public override void Initialize()
    {
        SetStartDate(2020, 6, 1);
        SetEndDate(2021, 6, 1);
        SetCash(100000);
        UniverseSettings.Asynchronous = True;
        _future = AddFuture(Futures.Metals.Gold);
        // 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 US Future universes, see Futures.

Accessing Data

For information about accessing US Future Universe data, see Futures.

Historical Data

You can get historical US Future Universe data in an algorithm and the Research Environment.

Historical Data In Algorithms

To get historical US Future Universe data in an algorithm, call the History<FutureUniverse>history method with continuous Future Symbol and a lookback period. This method returns the all the available contracts for each trading day, not the subset of contracts that pass your universe filter. If there is no data for the period you requested, the history result is empty.

# Add the Future and save a reference to it.
future = self.add_future(Futures.Metals.GOLD)

# DataFrame example where the columns are the FutureUniverse attributes:
history_df = self.history(FutureUniverse, future.symbol, 5, flatten=True)

# Series example where the values are lists of FutureUniverse objects: 
history_series = self.history(FutureUniverse, future.symbol, 5, flatten=False)

# FutureUniverse objects example:
history = self.history[FutureUniverse](future.symbol, 5)
// Add the Future and save a reference to it.
var future = AddFuture(Futures.Metals.Gold);

// Get historical data.
var history = History<FutureUniverse>(future.Symbol, 5);

For more information about historical US Future Universe data in algorithms, see Contracts.

Historical Data In Research

To get historical US Future Universe data in the Research Environment, call the History<FutureUniverse>history method with continuous Future Symbol and a time period. This method returns the all the available contracts for each trading day, not the subset of contracts that pass your universe filter. If there is no data for the period you requested, the history result is empty.

# Add the Future and save a reference to it.
future = qb.add_future(Futures.Metals.GOLD)

# DataFrame example where the columns are the FutureUniverse attributes:
history_df = qb.history(FutureUniverse, future.symbol, datetime(2025, 1, 1), datetime(2025, 4, 1), flatten=True)

# Series example where the values are lists of FutureUniverse objects: 
history_series = qb.history(FutureUniverse, future.symbol, 5, flatten=False)

# FutureUniverse objects example:
history = qb.history[FutureUniverse](future.symbol, datetime(2025, 1, 1), datetime(2025, 4, 1))
// Add the Future and save a reference to it.
var future = qb.AddFuture(Futures.Metals.Gold);

// Get historical data.
var history = qb.History<FutureUniverse>(future.Symbol, new DateTime(2025, 1, 1), new DateTime(2025, 4, 1));

For more information about historical US Future Universe data in the Research Environment, see Daily Prices History.

Supported Assets

The following list shows the available (162) Futures:

  • Futures.Currencies.AUD: Australian Dollar Futures (CME: 6A)
  • Futures.Currencies.AUDCAD: Australian Dollar/Canadian Dollar Futures (CME: ACD)
  • Futures.Currencies.AUDJPY: Australian Dollar/Japanese Yen Futures (CME: AJY)
  • Futures.Currencies.AUDNZD: Australian Dollar/New Zealand Dollar Futures (CME: ANE)
  • Futures.Currencies.BRL: Brazillian Real Futures (CME: 6L)
  • Futures.Currencies.BTC: Bitcoin Futures (CME: BTC)
  • Futures.Currencies.CAD: Canadian Dollar Futures (CME: 6C)
  • Futures.Currencies.CADJPY: Canadian Dollar/Japanese Yen Futures (CME: CJY)
  • Futures.Currencies.CHF: Swiss Franc Futures (CME: 6S)
  • Futures.Currencies.ETH: Ether Futures (CME: ETH)
  • Futures.Currencies.EUR: Euro FX Futures (CME: 6E)
  • Futures.Currencies.EURAUD: Euro/Australian Dollar Futures (CME: EAD)
  • Futures.Currencies.EURCAD: Euro/Canadian Dollar Futures (CME: ECD)
  • Futures.Currencies.EuroFXEminiFutures.Currencies.EURO_FX_EMINI: E-mini Euro FX Futures (CME: E7)
  • Futures.Currencies.EURSEK: Euro/Swedish Krona Futures (CME: ESK)
  • Futures.Currencies.GBP: British Pound Futures (CME: 6B)
  • Futures.Currencies.JapaneseYenEminiFutures.Currencies.JAPANESE_YEN_EMINI: E-mini Japanese Yen Futures (CME: J7)
  • Futures.Currencies.JPY: Japanese Yen Futures (CME: 6J)
  • Futures.Currencies.MicroAUDFutures.Currencies.MICRO_AUD: Micro AUD/USD Futures (CME: M6A)
  • Futures.Currencies.MicroBTCFutures.Currencies.MICRO_BTC: Micro Bitcoin Futures (CME: MBT)
  • Futures.Currencies.MicroCADFutures.Currencies.MICRO_CAD: Micro USD/CAD Futures (CME: M6C)
  • Futures.Currencies.MicroCADUSDFutures.Currencies.MICRO_CADUSD: Micro CAD/USD Futures (CME: MCD)
  • Futures.Currencies.MicroCHFFutures.Currencies.MICRO_CHF: Micro CHF/USD Futures (CME: MSF)
  • Futures.Currencies.MicroEtherFutures.Currencies.MICRO_ETHER: Micro Ether Futures (CME: MET)
  • Futures.Currencies.MicroEURFutures.Currencies.MICRO_EUR: Micro EUR/USD Futures (CME: M6E)
  • Futures.Currencies.MicroGBPFutures.Currencies.MICRO_GBP: Micro GBP/USD Futures (CME: M6B)
  • Futures.Currencies.MicroINRUSDFutures.Currencies.MICRO_INRUSD: Micro INR/USD Futures (CME: MIR)
  • Futures.Currencies.MicroJPYFutures.Currencies.MICRO_JPY: Micro JPY/USD Futures (CME: MJY)
  • Futures.Currencies.MicroUSDCHFFutures.Currencies.MICRO_USDCHF: Micro USD/CHF Futures (CME: M6S)
  • Futures.Currencies.MicroUSDCNHFutures.Currencies.MICRO_USDCNH: Micro USD/CNH Futures (CME: MNH)
  • Futures.Currencies.MicroUSDJPYFutures.Currencies.MICRO_USDJPY: Micro USD/JPY Futures (CME: M6J)
  • Futures.Currencies.MXN: Mexican Peso Futures (CME: 6M)
  • Futures.Currencies.NZD: New Zealand Dollar Futures (CME: 6N)
  • Futures.Currencies.RUB: Russian Ruble Futures (CME: 6R)
  • Futures.Currencies.StandardSizeUSDOffshoreRMBCNHFutures.Currencies.STANDARD_SIZE_USD_OFFSHORE_RMBCNH: Standard-Size USD/Offshore RMB (CNH) Futures (CME: CNH)
  • Futures.Currencies.ZAR: South African Rand Futures (CME: 6Z)
  • Futures.Dairy.CashSettledButterFutures.Dairy.CASH_SETTLED_BUTTER: Cash-settled Butter Futures (CME: CB)
  • Futures.Dairy.CashSettledCheeseFutures.Dairy.CASH_SETTLED_CHEESE: Cash-settled Cheese Futures (CME: CSC)
  • Futures.Dairy.ClassIIIMilkFutures.Dairy.CLASS_III_MILK: Class III Milk Futures (CME: DC)
  • Futures.Dairy.ClassIVMilkFutures.Dairy.CLASS_IV_MILK: Class IV Milk Futures (CME: GDK)
  • Futures.Dairy.DryWheyFutures.Dairy.DRY_WHEY: Dry Whey Futures (CME: DY)
  • Futures.Dairy.NonfatDryMilkFutures.Dairy.NONFAT_DRY_MILK: Non-fat Dry Milk Futures (CME: GNF)
  • Futures.Energy.ArgusLLSvsWTIArgusTradeMonthFutures.Energy.ARGUS_LL_SVS_WTI_ARGUS_TRADE_MONTH: Argus LLS vs. WTI (Argus) Trade Month Futures (NYMEX: AE5)
  • Futures.Energy.ArgusPropaneFarEastIndexFutures.Energy.ARGUS_PROPANE_FAR_EAST_INDEX: Argus Propane Far East Index Futures (NYMEX: A7E)
  • Futures.Energy.ArgusPropaneSaudiAramcoFutures.Energy.ARGUS_PROPANE_SAUDI_ARAMCO: Argus Propane (Saudi Aramco) Futures (NYMEX: A9N)
  • Futures.Energy.BrentCrudeOilVsDubaiCrudeOilPlattsFutures.Energy.BRENT_CRUDE_OIL_VS_DUBAI_CRUDE_OIL_PLATTS: Brent Crude Oil vs. Dubai Crude Oil (Platts) Futures (NYMEX: ADB)
  • Futures.Energy.BrentLastDayFinancialFutures.Energy.BRENT_LAST_DAY_FINANCIAL: Brent Last Day Financial Futures (NYMEX: BZ)
  • Futures.Energy.ChicagoEthanolPlattsFutures.Energy.CHICAGO_ETHANOL_PLATTS: Chicago Ethaanol (Platts) Futures (NYMEX: CU)
  • Futures.Energy.ClearbrookBakkenSweetCrudeOilMonthlyIndexNetEnergyFutures.Energy.CLEARBROOK_BAKKEN_SWEET_CRUDE_OIL_MONTHLY_INDEX_NET_ENERGY: Clearbrook Bakken Sweet Crude Oil Monthly Index (Net Energy) Futures (NYMEX: CSW)
  • Futures.Energy.ConwayPropaneOPISFutures.Energy.CONWAY_PROPANE_OPIS: Conway Propane (OPIS) Futures (NYMEX: A8K)
  • Futures.Energy.CrudeOilWTIFutures.Energy.CRUDE_OIL_WTI: Crude Oil WTI Futures (NYMEX: CL)
  • Futures.Energy.DubaiCrudeOilPlattsFinancialFutures.Energy.DUBAI_CRUDE_OIL_PLATTS_FINANCIAL: Dubai Crude Oil (Platts) Financial Futures (NYMEX: DCB)
  • Futures.Energy.EastWestGasolineSpreadPlattsArgusFutures.Energy.EAST_WEST_GASOLINE_SPREAD_PLATTS_ARGUS: East-West Gasoline Spread (Platts-Argus) Futures (NYMEX: EWG)
  • Futures.Energy.EastWestNaphthaJapanCFvsCargoesCIFNWESpreadPlattsFutures.Energy.EAST_WEST_NAPHTHA_JAPAN_C_FVS_CARGOES_CIFNWE_SPREAD_PLATTS: East-West Naphtha: Japan C&F vs. Cargoes CIF NWE Spread (Platts) Futures (NYMEX: EWN)
  • Futures.Energy.EthanolFutures.Energy.ETHANOL: Ethanol Futures (CBOT: EH)
  • Futures.Energy.EthanolT2FOBRdamIncludingDutyPlattsFutures.Energy.ETHANOL_T_2_FOB_RDAM_INCLUDING_DUTY_PLATTS: Ethanol T2 FOB Rdam Including Duty (Platts) Futures (NYMEX: AZ1)
  • Futures.Energy.EuropeanNaphthaPlattsCrackSpreadFutures.Energy.EUROPEAN_NAPHTHA_PLATTS_CRACK_SPREAD: European Naphtha (Platts) Crack Spread Futures (NYMEX: EN)
  • Futures.Energy.EuropeanPropaneCIFARAArgusFutures.Energy.EUROPEAN_PROPANE_CIFARA_ARGUS: European Propane CIF ARA (Argus) Futures (NYMEX: APS)
  • Futures.Energy.EuropeanPropaneCIFARAArgusVsNaphthaCargoesCIFNWEPlattsFutures.Energy.EUROPEAN_PROPANE_CIFARA_ARGUS_VS_NAPHTHA_CARGOES_CIFNWE_PLATTS: European Propane CIF ARA (Argus) vs. Naphtha Cargoes CIF NWE (Platts) Futures (NYMEX: EPN)
  • Futures.Energy.FreightRouteTC14BalticFutures.Energy.FREIGHT_ROUTE_TC_14_BALTIC: Freight Route TC14 (Baltic) Futures (NYMEX: FRC)
  • Futures.Energy.GasolineFutures.Energy.GASOLINE: Gasoline RBOB Futures (NYMEX: RB)
  • Futures.Energy.GasolineEurobobOxyNWEBargesArgusFutures.Energy.GASOLINE_EUROBOB_OXY_NWE_BARGES_ARGUS: Gasoline Euro-bob Oxy NWE Barges (Argus) Futures (NYMEX: B7H)
  • Futures.Energy.GroupThreeSuboctaneGasolinePlattsVsRBOBFutures.Energy.GROUP_THREE_SUBOCTANE_GASOLINE_PLATTS_VS_RBOB: Group Three Sub-octane Gasoliine (Platts) vs. RBOB Futures (NYMEX: AA8)
  • Futures.Energy.GroupThreeULSDPlattsVsNYHarborULSDFutures.Energy.GROUP_THREE_ULSD_PLATTS_VS_NY_HARBOR_ULSD: Group Three ULSD (Platts) vs. NY Harbor ULSD Futures (NYMEX: AA6)
  • Futures.Energy.GulfCoastCBOBGasolineA2PlattsVsRBOBGasolineFutures.Energy.GULF_COAST_CBOB_GASOLINE_A_2_PLATTS_VS_RBOB_GASOLINE: Gulf Coast CBOB Gasoline A2 (Platts) vs. RBOB Gasoline Futures (NYMEX: CRB)
  • Futures.Energy.GulfCoastHSFOPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlattsFutures.Energy.GULF_COAST_HSFO_PLATTS_VS_EUROPEAN_THREE_POINT_FIVE_PERCENT_FUEL_OIL_BARGES_FOB_RDAM_PLATTS: Gulf Coast HSFO (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures (NYMEX: GCU)
  • Futures.Energy.HeatingOilFutures.Energy.HEATING_OIL: Heating Oil Futures (NYMEX: HO)
  • Futures.Energy.LosAngelesCARBOBGasolineOPISvsRBOBGasolineFutures.Energy.LOS_ANGELES_CARBOB_GASOLINE_OPI_SVS_RBOB_GASOLINE: Los Angeles CARBOB Gasoline (OPIS) vs. RBOB Gasoline Futures (NYMEX: AJL)
  • Futures.Energy.LosAngelesCARBDieselOPISvsNYHarborULSDFutures.Energy.LOS_ANGELES_CARB_DIESEL_OPI_SVS_NY_HARBOR_ULSD: Los Angeles CARB Diesel (OPIS) vs. NY Harbor ULSD Futures (NYMEX: AKL)
  • Futures.Energy.LosAngelesJetOPISvsNYHarborULSDFutures.Energy.LOS_ANGELES_JET_OPI_SVS_NY_HARBOR_ULSD: Los Angeles Jet (OPIS) vs. NY Harbor ULSD Futures (NYMEX: AJS)
  • Futures.Energy.MarsArgusVsWTIFinancialFutures.Energy.MARS_ARGUS_VS_WTI_FINANCIAL: Mars (Argus) vs. WTI Financial Futures (NYMEX: AYX)
  • Futures.Energy.MarsArgusVsWTITradeMonthFutures.Energy.MARS_ARGUS_VS_WTI_TRADE_MONTH: Mars (Argus) vs. WTI Trade Month Futures (NYMEX: AYV)
  • Futures.Energy.MicroCrudeOilWTIFutures.Energy.MICRO_CRUDE_OIL_WTI: Micro WTI Crude Oil Futures (NYMEX: MCL)
  • Futures.Energy.MicroEuropeanFOBRdamMarineFuelZeroPointFivePercentBargesPlattsFutures.Energy.MICRO_EUROPEAN_FOB_RDAM_MARINE_FUEL_ZERO_POINT_FIVE_PERCENT_BARGES_PLATTS: Micro European FOB Rdam Marine Fuel 0.5% Barges (Platts) Futures (NYMEX: R5O)
  • Futures.Energy.MicroEuropeanThreePointFivePercentOilBargesFOBRdamPlattsFutures.Energy.MICRO_EUROPEAN_THREE_POINT_FIVE_PERCENT_OIL_BARGES_FOB_RDAM_PLATTS: Micro European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures (NYMEX: MEF)
  • Futures.Energy.MicroGasoilZeroPointOnePercentBargesFOBARAPlattsFutures.Energy.MICRO_GASOIL_ZERO_POINT_ONE_PERCENT_BARGES_FOBARA_PLATTS: Micro Gasoil 0.1% Barges FOB ARA (Platts) Futures (NYMEX: M1B)
  • Futures.Energy.MicroSingaporeFOBMarineFuelZeroPointFivePercetPlattsFutures.Energy.MICRO_SINGAPORE_FOB_MARINE_FUEL_ZERO_POINT_FIVE_PERCET_PLATTS: Micro Singapore FOB Marine Fuel 0.5% (Platts) Futures (NYMEX: S5O)
  • Futures.Energy.MicroSingaporeFuelOil380CSTPlattsFutures.Energy.MICRO_SINGAPORE_FUEL_OIL_380_CST_PLATTS: Micro Singapore Fuel Oil 380CST (Platts) Futures (NYMEX: MAF)
  • Futures.Energy.MiniEuropeanThreePointPercentFiveFuelOilBargesPlattsFutures.Energy.MINI_EUROPEAN_THREE_POINT_PERCENT_FIVE_FUEL_OIL_BARGES_PLATTS: Mini European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures (NYMEX: A0D)
  • Futures.Energy.MiniSingaporeFuelOil180CstPlattsFutures.Energy.MINI_SINGAPORE_FUEL_OIL_180_CST_PLATTS: Mini Singapore Fuel Oil 180 cst (Platts) Futures (NYMEX: A0F)
  • Futures.Energy.MontBelvieuEthaneOPISFutures.Energy.MONT_BELVIEU_ETHANE_OPIS: Mont Belvieu Ethane (OPIS) Futures (NYMEX: AC0)
  • Futures.Energy.MontBelvieuLDHPropaneOPISFutures.Energy.MONT_BELVIEU_LDH_PROPANE_OPIS: Mont Belvieu LDH Propane (OPIS) Futures (NYMEX: B0)
  • Futures.Energy.MontBelvieuNaturalGasolineOPISFutures.Energy.MONT_BELVIEU_NATURAL_GASOLINE_OPIS: Mont Belvieu Natural Gasoline (OPIS) Futures (NYMEX: A7Q)
  • Futures.Energy.MontBelvieuNormalButaneOPISFutures.Energy.MONT_BELVIEU_NORMAL_BUTANE_OPIS: Mont Belvieu Normal Butane (OPIS) Futures (NYMEX: AD0)
  • Futures.Energy.NaturalGasFutures.Energy.NATURAL_GAS: Natural Gas Futures (NYMEX: NG)
  • Futures.Energy.NaturalGasHenryHubLastDayFinancialFutures.Energy.NATURAL_GAS_HENRY_HUB_LAST_DAY_FINANCIAL: Natural Gas (Henry Hub) Last-day Financial Futures (NYMEX: HH)
  • Futures.Energy.NaturalGasHenryHubPenultimateFinancialFutures.Energy.NATURAL_GAS_HENRY_HUB_PENULTIMATE_FINANCIAL: Natural Gas (Henry Hub) Penultimate Financial Futures (NYMEX: HP)
  • Futures.Energy.OnePercentFuelOilCargoesFOBNWEPlattsVsThreePointFivePercentFuelOilBargesFOBRdamPlattsFutures.Energy.ONE_PERCENT_FUEL_OIL_CARGOES_FOBNWE_PLATTS_VS_THREE_POINT_FIVE_PERCENT_FUEL_OIL_BARGES_FOB_RDAM_PLATTS: 1% Fuel Oil Cargoes FOB NWE (Platts) vs. 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures (NYMEX: FSS)
  • Futures.Energy.PremiumUnleadedGasoline10ppmFOBMEDPlattsFutures.Energy.PREMIUM_UNLEADED_GASOLINE_10_PPM_FOBMED_PLATTS: Premium Unleaded Gasoline 10 ppm FOB MED (Platts) Futures (NYMEX: A3G)
  • Futures.Energy.PropaneNonLDHMontBelvieuOPISFutures.Energy.PROPANE_NON_LDH_MONT_BELVIEU_OPIS: Propane Non-LDH Mont Belvieu (OPIS) Futures (NYMEX: A1R)
  • Futures.Energy.RBOBGasolineCrackSpreadFutures.Energy.RBOB_GASOLINE_CRACK_SPREAD: RBOB Gasoline Crack Spread Futures (NYMEX: ARE)
  • Futures.Energy.RBOBGasolineVsEurobobOxyNWEBargesArgusThreeHundredFiftyThousandGallonsFutures.Energy.RBOB_GASOLINE_VS_EUROBOB_OXY_NWE_BARGES_ARGUS_THREE_HUNDRED_FIFTY_THOUSAND_GALLONS: RBOB Gasoline vs. Euro-bob Oxy NWE Barges (Argus) (350,000 gallons) Futures (NYMEX: EXR)
  • Futures.Energy.SingaporeFuelOil380cstPlattsVsEuropeanThreePointFivePercentFuelOilBargesFOBRdamPlattsFutures.Energy.SINGAPORE_FUEL_OIL_380_CST_PLATTS_VS_EUROPEAN_THREE_POINT_FIVE_PERCENT_FUEL_OIL_BARGES_FOB_RDAM_PLATTS: Singapore Fuel Oil 380 cst (Platts) vs. European 3.5% Fuel Oil Barges FOB Rdam (Platts) Futures (NYMEX: EVC)
  • Futures.Energy.SingaporeGasoilPlattsVsLowSulphurGasoilFuturesFutures.Energy.SINGAPORE_GASOIL_PLATTS_VS_LOW_SULPHUR_GASOIL_FUTURES: Singapore Gasoil (Platts) vs. Low Sulphur Gasoil Futures (NYMEX: AGA)
  • Futures.Energy.SingaporeMogas92UnleadedPlattsBrentCrackSpreadFutures.Energy.SINGAPORE_MOGAS_92_UNLEADED_PLATTS_BRENT_CRACK_SPREAD: Singapore Mogas 92 Unleaded (Platts) Brent Crack Spread Futures (NYMEX: D1N)
  • Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpreadFutures.Energy.THREE_POINT_FIVE_PERCENT_FUEL_OIL_BARGES_FOB_RDAM_PLATTS_CRACK_SPREAD: 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread Futures (NYMEX: FO)
  • Futures.Energy.ThreePointFivePercentFuelOilBargesFOBRdamPlattsCrackSpread1000mtFutures.Energy.THREE_POINT_FIVE_PERCENT_FUEL_OIL_BARGES_FOB_RDAM_PLATTS_CRACK_SPREAD_1000_MT: 3.5% Fuel Oil Barges FOB Rdam (Platts) Crack Spread (1000mt) Futures (NYMEX: BOO)
  • Futures.Energy.WTIBrentFinancialFutures.Energy.WTI_BRENT_FINANCIAL: WTI-Brent Financial Futures (NYMEX: BK)
  • Futures.Energy.WTIFinancialFutures.Energy.WTI_FINANCIAL: WTI Financial Futures (NYMEX: CSX)
  • Futures.Energy.WTIHoustonArgusVsWTITradeMonthFutures.Energy.WTI_HOUSTON_ARGUS_VS_WTI_TRADE_MONTH: WTI Houston (Argus) vs. WTI Trade Month Futures (NYMEX: HTT)
  • Futures.Energy.WTIHoustonCrudeOilFutures.Energy.WTI_HOUSTON_CRUDE_OIL: WTI Houston Crude Oil Futures (NYMEX: HCL)
  • Futures.Financials.EuroDollarFutures.Financials.EURO_DOLLAR: EuroDollar Futures (CME: GE)
  • Futures.Financials.FiveYearUSDMACSwapFutures.Financials.FIVE_YEAR_USDMAC_SWAP: 5-Year USD MAC Swap Futures (CBOT: F1U)
  • Futures.Financials.MicroY10TreasuryNoteFutures.Financials.MICRO_Y_10_TREASURY_NOTE: Micro 10-Year Yield Futures (CBOT: 10Y)
  • Futures.Financials.MicroY2TreasuryBondFutures.Financials.MICRO_Y_2_TREASURY_BOND: Micro 2-Year Yield Futures (CBOT: 2YY)
  • Futures.Financials.MicroY30TreasuryBondFutures.Financials.MICRO_Y_30_TREASURY_BOND: Micro 30-Year Yield Futures (CBOT: 30Y)
  • Futures.Financials.MicroY5TreasuryBondFutures.Financials.MICRO_Y_5_TREASURY_BOND: Micro 5-Year Yield Futures (CBOT: 5YY)
  • Futures.Financials.UltraTenYearUSTreasuryNoteFutures.Financials.ULTRA_TEN_YEAR_US_TREASURY_NOTE: Ultra 10-Year U.S. Treasury Note Futures (CBOT: TN)
  • Futures.Financials.UltraUSTreasuryBondFutures.Financials.ULTRA_US_TREASURY_BOND: Ultra U.S. Treasury Bond Futures (CBOT: UB)
  • Futures.Financials.Y10TreasuryNoteFutures.Financials.Y_10_TREASURY_NOTE: 10Y U.S. Treasury Note Futures (CBOT: ZN)
  • Futures.Financials.Y2TreasuryNoteFutures.Financials.Y_2_TREASURY_NOTE: 2Y U.S. Treasury Note Futures (CBOT: ZT)
  • Futures.Financials.Y30TreasuryBondFutures.Financials.Y_30_TREASURY_BOND: 30Y U.S. Treasury Bond Futures (CBOT: ZB)
  • Futures.Financials.Y5TreasuryNoteFutures.Financials.Y_5_TREASURY_NOTE: 5Y U.S. Treasury Note Futures (CBOT: ZF)
  • Futures.Forestry.LumberFutures.Forestry.LUMBER: Lumber Futures (CME: LBR)
  • Futures.Forestry.RandomLengthLumberFutures.Forestry.RANDOM_LENGTH_LUMBER: Random Length Lumber Futures (CME: LBS)
  • Futures.Grains.BlackSeaCornFinanciallySettledPlattsFutures.Grains.BLACK_SEA_CORN_FINANCIALLY_SETTLED_PLATTS: Black Sea Corn Financially Settled (Platts) Futures (CBOT: BCF)
  • Futures.Grains.BlackSeaWheatFinanciallySettledPlattsFutures.Grains.BLACK_SEA_WHEAT_FINANCIALLY_SETTLED_PLATTS: Black Sea Wheat Financially Settled (Platts) Futures (CBOT: BWF)
  • Futures.Grains.CornFutures.Grains.CORN: Corn Futures (CBOT: ZC)
  • Futures.Grains.HRWWheatFutures.Grains.HRW_WHEAT: KC HRW Wheat Futures (CBOT: KE)
  • Futures.Grains.OatsFutures.Grains.OATS: Oats Futures (CBOT: ZO)
  • Futures.Grains.SoybeansFutures.Grains.SOYBEANS: Soybeans Futures (CBOT: ZS)
  • Futures.Grains.SoybeanMealFutures.Grains.SOYBEAN_MEAL: Soybean Meal Futures (CBOT: ZM)
  • Futures.Grains.SoybeanOilFutures.Grains.SOYBEAN_OIL: Soybean Oil Futures (CBOT: ZL)
  • Futures.Grains.WheatFutures.Grains.WHEAT: Default wheat contract is SRWWheat (CBOT: ZW)
  • Futures.Indices.BloombergCommodityIndexFutures.Indices.BLOOMBERG_COMMODITY_INDEX: Bloomberg Commodity Index Futures (CBOT: AW)
  • Futures.Indices.Dow30EMiniFutures.Indices.DOW_30_E_MINI: E-mini Dow Indu 30 Futures (CBOT: YM)
  • Futures.Indices.DowJonesRealEstateFutures.Indices.DOW_JONES_REAL_ESTATE: (CME: RX)
  • Futures.Indices.FTSEEmergingEminiFutures.Indices.FTSE_EMERGING_EMINI: E-mini FTSE Emerging Index Futures (CME: EI)
  • Futures.Indices.MicroDow30EMiniFutures.Indices.MICRO_DOW_30_E_MINI: Micro E-mini Dow Jones Industrial Average Index Futures (CBOT: MYM)
  • Futures.Indices.MicroNASDAQ100EMiniFutures.Indices.MICRO_NASDAQ_100_E_MINI: Micro E-mini Nasdaq-100 Index Futures (CME: MNQ)
  • Futures.Indices.MicroRussell2000EMiniFutures.Indices.MICRO_RUSSELL_2000_E_MINI: Micro E-mini Russell 2000 Index Futures (CME: M2K)
  • Futures.Indices.MicroSP500EMiniFutures.Indices.MICRO_SP_500_E_MINI: Micro E-mini S&P 500 Index Futures (CME: MES)
  • Futures.Indices.NASDAQ100BiotechnologyEMiniFutures.Indices.NASDAQ_100_BIOTECHNOLOGY_E_MINI: E-mini Nasdaq-100 Biotechnology Index Futures (CME: BIO)
  • Futures.Indices.NASDAQ100EMiniFutures.Indices.NASDAQ_100_E_MINI: E-mini NASDAQ 100 Futures (CME: NQ)
  • Futures.Indices.Nikkei225DollarFutures.Indices.NIKKEI_225_DOLLAR: Nikkei-225 Dollar Futures (CME: NKD)
  • Futures.Indices.Nikkei225YenCMEFutures.Indices.NIKKEI_225_YEN_CME: Nikkei-225 Yen denominated Futures on CME (CME: NIY)
  • Futures.Indices.Russell1000EMiniFutures.Indices.RUSSELL_1000_E_MINI: (CME: RS1)
  • Futures.Indices.Russell2000EMiniFutures.Indices.RUSSELL_2000_E_MINI: E-mini Russell 2000 Futures (CME: RTY)
  • Futures.Indices.SPGSCICommodityFutures.Indices.SPGSCI_COMMODITY: S&P-GSCI Commodity Index Futures (CME: GD)
  • Futures.Indices.SP400MidCapEminiFutures.Indices.SP_400_MID_CAP_EMINI: E-mini S&P MidCap 400 Futures (CME: EMD)
  • Futures.Indices.SP500AnnualDividendIndexFutures.Indices.SP_500_ANNUAL_DIVIDEND_INDEX: (CME: SDA)
  • Futures.Indices.SP500EMiniFutures.Indices.SP_500_E_MINI: E-mini S&P 500 Futures (CME: ES)
  • Futures.Indices.TOPIXYEN: (CME: TPY)
  • Futures.Indices.USDDenominatedIbovespaFutures.Indices.USD_DENOMINATED_IBOVESPA: USD-Denominated Ibovespa Index Futures (CME: IBV)
  • Futures.Indices.VIX: CBOE Volatility Index Futures (CFE: VX)
  • Futures.Meats.FeederCattleFutures.Meats.FEEDER_CATTLE: Feeder Cattle Futures (CME: GF)
  • Futures.Meats.LeanHogsFutures.Meats.LEAN_HOGS: Lean Hogs Futures (CME: HE)
  • Futures.Meats.LiveCattleFutures.Meats.LIVE_CATTLE: Live Cattle Futures (CME: LE)
  • Futures.Metals.AluminiumEuropeanPremiumDutyPaidMetalBulletinFutures.Metals.ALUMINIUM_EUROPEAN_PREMIUM_DUTY_PAID_METAL_BULLETIN: Aluminium European Premium Duty-Paid (Metal Bulletin) Futures (COMEX: EDP)
  • Futures.Metals.AluminumMWUSTransactionPremiumPlatts25MTFutures.Metals.ALUMINUM_MWUS_TRANSACTION_PREMIUM_PLATTS_25_MT: Aluminum MW U.S. Transaction Premium Platts (25MT) Futures (COMEX: AUP)
  • Futures.Metals.CopperFutures.Metals.COPPER: Copper Futures (COMEX: HG)
  • Futures.Metals.GoldFutures.Metals.GOLD: Gold Futures (COMEX: GC)
  • Futures.Metals.MicroGoldFutures.Metals.MICRO_GOLD: Micro Gold Futures (COMEX: MGC)
  • Futures.Metals.MicroGoldTASFutures.Metals.MICRO_GOLD_TAS: Micro Gold TAS Futures (COMEX: MGT)
  • Futures.Metals.MicroPalladiumFutures.Metals.MICRO_PALLADIUM: Micro Palladium Futures (NYMEX: PAM)
  • Futures.Metals.MicroSilverFutures.Metals.MICRO_SILVER: Micro Silver Futures (COMEX: SIL)
  • Futures.Metals.PalladiumFutures.Metals.PALLADIUM: Palladium Futures (NYMEX: PA)
  • Futures.Metals.PlatinumFutures.Metals.PLATINUM: Platinum Futures (NYMEX: PL)
  • Futures.Metals.SilverFutures.Metals.SILVER: Silver Futures (COMEX: SI)
  • Futures.Metals.USMidwestDomesticHotRolledCoilSteelCRUIndexFutures.Metals.US_MIDWEST_DOMESTIC_HOT_ROLLED_COIL_STEEL_CRU_INDEX: U.S. Midwest Domestic Hot-Rolled Coil Steel (CRU) Index Futures (NYMEX: HRC)
  • Futures.Softs.Sugar11Futures.Softs.SUGAR_11: Sugar #11 Futures ICE (ICE: SB)
  • Futures.Softs.Sugar11CMEFutures.Softs.SUGAR_11_CME: Sugar #11 Futures CME (NYMEX: YO)

Example Applications

The US Future Universe dataset enables you to accurately design Futures strategies. Examples include the following strategies:

  • Buying the Futures contract with the most open interest to reduce slippage and market impact
  • Trading bull calendar spreads to reduce volatility and margin requirements
  • Trading bull calendar spreads to speculate contango

Classic Algorithm Example

The following example algorithm selects and buys the front-month Mini Gold Futures contract and sells the front-month Micro Gold Futures contract. When the front-month contract changes, the algorithm rebalances the portfolio.

class USFuturesDataAlgorithm(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
        # Requesting data on gold and micro-gold contracts.
        # Filter the universe to trade only the contracts expiring within 90 days to ensure liquidity.
        self.mini_gold = self.add_future(Futures.Metals.GOLD) 
        self.mini_gold.set_filter(0, 90)
        
        self.micro_gold = self.add_future(Futures.Metals.MICRO_GOLD) 
        self.micro_gold.set_filter(0, 90)
        
        # Save a cache of the mapped symbol to trade.
        self.contract = {self.mini_gold.symbol: None, self.micro_gold.symbol: None}
    
    def on_data(self, slice: Slice) -> None:
        for symbol, chain in slice.future_chains.items():
            if symbol in self.contract:
                # Select the contract with the greatest open interest to trade with the most efficiency.
                most_liquid_contract = sorted(chain, key=lambda contract: contract.open_interest, reverse=True)[0]
                
                if self.contract[symbol] is None or most_liquid_contract.symbol != self.contract[symbol].symbol:
                    # Liquidate any unmapped contracts.
                    if self.contract[symbol] is not None:
                        self.liquidate(self.contract[symbol].symbol)
                    self.contract[symbol] = most_liquid_contract
                    
                    # Buy mini-gold and short micro-gold contracts as planned.
                    if symbol == self.mini_gold.symbol:
                        self.market_order(self.contract[symbol].symbol, 1)
                    elif symbol == self.micro_gold.symbol:
                        self.market_order(self.contract[symbol].symbol, -1)
public class USFuturesDataAlgorithm : QCAlgorithm
{
    private Future _miniGold;
    private Future _microGold;
    // Save a cache of the mapped symbol to trade.
    private Dictionary<Symbol, FuturesContract?> _contract = new ();
    
    public override void Initialize()
    {
        SetStartDate(2013, 12, 20);
        SetEndDate(2014, 2, 20);
        SetCash(1000000);
        UniverseSettings.Asynchronous = True;

        // Requesting data on gold and micro-gold contracts.
        // Filter the universe to trade only the contracts expiring within 90 days to ensure liquidity.
        _miniGold = AddFuture(Futures.Metals.Gold);
        _miniGold.SetFilter(0, 90);
        _contract.Add(_miniGold.Symbol, None);
        
        _microGold = AddFuture(Futures.Metals.MicroGold);
        _microGold.SetFilter(0, 90);
        _contract.Add(_microGold.Symbol, None);
    }

    public override void OnData(Slice slice)
    {
        foreach (var (symbol, chain) in slice.FutureChains)
        {
            if (_contract.ContainsKey(symbol))
            {
                // Select the contract with the greatest open interest to trade with the most efficiency.
                var mostLiquidContract = chain.OrderBy(x => x.OpenInterest).Last();
                
                if (_contract[symbol] == None || mostLiquidContract.Symbol != _contract[symbol].Symbol)
                {
                    // Liquidate any unmapped contracts.
                    if (_contract[symbol] != None)
                    {
                        Liquidate(_contract[symbol].Symbol);
                    }
                    _contract[symbol] = mostLiquidContract;

                    // Buy mini-gold and short micro-gold contracts as planned.
                    if (symbol == _miniGold.Symbol)
                    {
                        MarketOrder(_contract[symbol].Symbol, 1);
                    }
                    else if (symbol == _microGold.Symbol)
                    {
                        MarketOrder(_contract[symbol].Symbol, -1);
                    }
                }
            }
        }
    }
}

Framework Algorithm Example

The following example algorithm selects and buys the front-month Mini Gold Futures contract and sells the front-month Micro Gold Futures contract. When the front-month contract changes, the algorithm rebalances the portfolio.

from AlgorithmImports import *
from QuantConnect.DataSource import *
from Selection.FutureUniverseSelectionModel import FutureUniverseSelectionModel

class USFuturesDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:

        self.set_start_date(2013, 12, 20) 
        self.set_end_date(2014, 2, 20)
        self.set_cash(100000)
        self.universe_settings.asynchronous = True
        # Set up an universe selection model that selects the front month contract
        self.set_universe_selection(FrontMonthFutureUniverseSelectionModel())
        self.add_alpha(ConstantFuturesAlphaModel())
        # A portfolio construction model that only order a single share per insight signal
        self.set_portfolio_construction(SingleSharePortfolioConstructionModel())
        
class FrontMonthFutureUniverseSelectionModel(FutureUniverseSelectionModel):
    def __init__(self,) -> None:
        # Daily updating with select_future_chain_symbols function
        super().__init__(timedelta(1), self.select_future_chain_symbols)

    def select_future_chain_symbols(self, utcTime: datetime) -> List[Symbol]:
        # Select gold and micro gold contracts for the strategy need
        future_pairs = [
            (Futures.Metals.GOLD, Market.COMEX),
            (Futures.Metals.MICRO_GOLD, Market.COMEX)
        ]
        return [Symbol.create(pair[0], SecurityType.FUTURE, pair[1]) for pair in future_pairs]

    def filter(self, filter: FutureFilterUniverse) -> FutureFilterUniverse:
        # Filter only front month contract for liquidity and most informed information
        return filter.front_month().only_apply_filter_at_market_open()

class ConstantFuturesAlphaModel(AlphaModel):
    # Long gold and short micro gold in this strategy
    long_symbol = Symbol.create(Futures.Metals.GOLD, SecurityType.FUTURE, Market.COMEX)
    short_symbol = Symbol.create(Futures.Metals.MICRO_GOLD, SecurityType.FUTURE, Market.COMEX)
        
    def update(self, algorithm: QCAlgorithm, slice: Slice) -> List[Insight]:
        if algorithm.portfolio.invested:
            return []
        
        insights = []
        # For both gold and micro gold, select the front month contract (only contract) in the chain
        for kvp in slice.future_chains:
            chain = [contract for contract in kvp.Value]
            contract = chain[0]
            
            # Long gold and short micro gold as planned
            if kvp.Key == self.long_symbol:
                insights.append(Insight.price(contract.symbol, contract.expiry + timedelta(days=1), InsightDirection.UP))
            elif kvp.Key == self.short_symbol:
                insights.append(Insight.price(contract.symbol, contract.expiry + timedelta(days=1), InsightDirection.DOWN))
        
        return insights
        
    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:
        for security in changes.added_securities:
            # Historical data
            history = algorithm.history(security.symbol, 10, Resolution.MINUTE)
            algorithm.debug(f"We got {len(history)} from our history request for {security.symbol}")

class SingleSharePortfolioConstructionModel(PortfolioConstructionModel):
    def create_targets(self, algorithm: QCAlgorithm, insights: List[Insight]) -> List[PortfolioTarget]:
        targets = []
        for insight in insights:
            if algorithm.securities[insight.symbol].is_tradable:
                # Single share only using integer portfolio target
                targets.append(PortfolioTarget(insight.symbol, insight.direction))
        return targets
public class USFuturesDataAlgorithm : QCAlgorithm
{        
    public override void Initialize()
    {
        SetStartDate(2013, 12, 20);
        SetEndDate(2014, 2, 20);
        SetCash(1000000);
        UniverseSettings.Asynchronous = True;
        // Set up an universe selection model that selects the front month contract
        SetUniverseSelection(new FrontMonthFutureUniverseSelectionModel());
        SetAlpha(new ConstantFuturesAlphaModel());
        // A portfolio construction model that only order a single share per insight signal
        SetPortfolioConstruction(new SingleSharePortfolioConstructionModel());
    }
}
    
class FrontMonthFutureUniverseSelectionModel : FutureUniverseSelectionModel
{
    // Daily updating with select_future_chain_symbols function
    public FrontMonthFutureUniverseSelectionModel()
        : base(TimeSpan.FromDays(1), SelectFutureChainSymbols) {}

    private static IEnumerable<Symbol> SelectFutureChainSymbols(DateTime utcTime)
    {
        //Select gold and micro gold contracts for the strategy need
        return new List<Symbol> {
            QuantConnect.Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX),
            QuantConnect.Symbol.Create(Futures.Metals.MicroGold, SecurityType.Future, Market.COMEX)
        };
    }

    protected override FutureFilterUniverse Filter(FutureFilterUniverse filter)
    {
        // Filter only front month contract for liquidity and most informed information
        return filter.FrontMonth().OnlyApplyFilterAtMarketOpen();
    }
}


class ConstantFuturesAlphaModel : AlphaModel
{
    // Long gold and short micro gold in this strategy
    private Symbol 
        _longSymbol = QuantConnect.Symbol.Create(Futures.Metals.Gold, SecurityType.Future, Market.COMEX), 
        _shortSymbol = QuantConnect.Symbol.Create(Futures.Metals.MicroGold, SecurityType.Future, Market.COMEX);
    
    public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice slice)
    {
        var insights = new List<Insight>();

        if (algorithm.Portfolio.Invested)
        {
            return insights;
        }
        
        // For both gold and micro gold, select the front month contract (only contract) in the chain
        foreach (var kvp in slice.FutureChains)
        {
            var symbol = kvp.Key;
            var chain = kvp.Value;
            var contract = chain.First();
            
            // Long gold and short micro gold as planned
            if (symbol == _longSymbol)
            {
                insights.Add(Insight.Price(contract.Symbol, contract.Expiry + TimeSpan.FromDays(1), InsightDirection.Up));
            }
            else if (symbol == _shortSymbol)
            {
                insights.Add(Insight.Price(contract.Symbol, contract.Expiry + TimeSpan.FromDays(1), InsightDirection.Down));
            }
        }

        return insights;
    }
    
    public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)
    {
        foreach (var security in changes.AddedSecurities)
        {
            // Historical data
            var history = algorithm.History(security.Symbol, 100, Resolution.Minute);
            algorithm.Debug($"We got {history.Count()} from our history request for {security.Symbol}");
        }
    }
}
    
    
class SingleSharePortfolioConstructionModel : PortfolioConstructionModel
{
    public override IEnumerable<PortfolioTarget> CreateTargets(QCAlgorithm algorithm, Insight[] insights)
    {
        var targets = new List<PortfolioTarget>();
        foreach (var insight in insights)
        {
            if (algorithm.Securities[insight.Symbol].IsTradable)
            {
                // Single share only using integer portfolio target
                targets.Add(new PortfolioTarget(insight.Symbol, (int) insight.Direction));
            }
        }
        return targets;
    }
}

Data Point Attributes

The US Future Universe dataset provides FutureFilterUniverse and FutureUniverse objects.

FutureFilterUniverse Attributes

FutureFilterUniverse objects have the following attributes:

FutureUniverse Attributes

FutureUniverse objects have the following attributes:

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: