Files
Jhonathan Abreu 69d2f5ae82
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Regression Tests / build (push) Has been cancelled
Futures and Future Options file-based universes (#8480)
* Make FOPs selection universe file-based for backtesting

* Make FOPs option chains universe file based

* Make Future universe selection file-based like option universe

* Make Future universe selection file-based like option universe

* Abstraction cleanup

* Add FuturesChains API to QC algorithm

Also refactor future chain provider to use the new FutureUniverse instead of zip file names

* Update regression algorithms stats

* Refactor QuantBook option and future history to use new universes

* Fix failing tests

* Fix failing tests

* Fix failing tests

* Minor future chains unit test improvement

* Add futures chains DataFrame property

Also, remove IDerivativeSecurity interface from Future

* Add DataFrame property to FuturesChains class

* Add regression algorithms

* Add regression algorithms

* Replace QCAlgorithm.FutureChainProvider usages with new FuturesChain api

* Minor fixes

* Reduce number of universe files in repo

* Minor data fixes

* Regression algorithms updates

* Add implicit conversion from FuturesContract to Symbol

Modified algorithms to use futures contract objects directly instead of accessing their Symbol property.
Removed unnecessary import statements and redundant lines in various files.

* Improve resolution handling for history requests

* Changed _auxiliaryData field to lazily-initialized AuxiliaryData property

* Refactor data handling in BaseChain and TimeSliceFactory

- Added `AddData` method to `BaseChain` for adding market data
- Refactored `TimeSliceFactory` to use `BaseChain.AddData` method

* Remove specific constructors and indexers from Chain classes

Removed public indexers in `BaseChains` for getting or setting `BaseChain` instances by `ticker` or `Symbol`, which were used for Pythonnet compatibility.

* Remove chain cache logic from FuturesChainUniverse

* Refactor class and interface names for clarity

Renamed `FileBasedUniverse` to `BaseChainUniverseData` and
`IFileBasedUniverse` to `IChainUniverseData`.

* Add base class for options and futures contracts

- Introduced `BaseContract` as an abstract base class for contracts, consolidating common properties and methods.
- Removed ISymbolInterface

* Add minor fix for future options tickers parsing

Added tests

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Clean chain provider classes up

* Remove ZipEntryName other classes and unused code

Removed ZipEntryName class and references across various files.
Removed DataQueueFuturesChainUniverseDataCollectionEnumerator and DataQueueOptionChainUniverseDataCollectionEnumerator classes.
Removed OptionChainUniverseSubscriptionEnumeratorFactory class.
Removed unused code for handling OptionChainUniverse and FuturesChainUniverse in FileSystemDataFeed.cs and LiveTradingDataFeed.cs.
Removed several test files related to enumerator factories and universe data collection.

* Minor changes and cleanup

* Trigger Build

* Trigger Build

* Refactor FuturesContract data handling

Forward price data from bars and ticks stored in private fields for improved memory usage

* Fix: use universe data for market data in FuturesContract

* Update regression algorithms stats after rebase

Added HSI futures universe files

* Sort configs by internal flag

Internals go first

* Throw from option universe data filters for future options

Future options IV, Open interest and greeks are not supported for future options

* Minor changes

* Improve some regression algorithms

* Minor fix for failing unit tests

* Update FOPs universe file header

Removed greeks and IV columns.
Updated FOPs universe files: removed outdated columns.

* Minor unit test fix

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Minor fix

* Add history provider as constructor argument for chain providers

* Update new regression algorithms data points count

* Minor fix for FakeDataQueue

* Add initialize method to chain providers classes

* Minor changes

* Trigger Build

* Trigger Build

* Trigger Build

* Minor fix

* Minor fix

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build

* Add logs to ProcessedDataProvider

* Removed test logs

* Minor fix

* Support downloading options and futures universe files from api data provider
2025-03-25 16:22:38 -04:00
..
2021-09-28 14:21:07 -03:00
2020-04-28 16:29:54 -03:00

alt tag

LEAN Data Formats / Futures

QuantConnect hosts futures data provided by AlgoSeek. The data contains quotes, trades, and open interest data. You can explore futures data on our website at https://www.quantconnect.com/data/tree/future

The data are stored as compressed ZIP files, each capable of containing a single, or multiple CSV files, depending on the resolution requested.

Futures data can be used with the following Resolutions:

  • Tick
  • Second
  • Minute

The markets we currently support are:

  • CBOT
  • CME
  • NYMEX
  • COMEX
  • CBOE
  • ICE

tickType in this documentation can refer to one of the following:

  • trade
  • quote
  • openinterest

Minute and Second File Format

Second/Minute files are located in the future / market / resolution / symbol folder. The zip file contains multiple csv entries, varying by the symbol's expiration date.

The zip files have the filename format: YYYYMMDD_tickType.zip. The CSV file contained within has the filename: YYYYMMDD_symbol_resolution_tickType_symbolExpirationDate.csv

Second/Minute trade schema and example data is as follows:

Time Open High Low Close Volume
63271000 85.22 85.24 85.21 85.24 126
  • Time - Milliseconds since midnight
  • Open - Opening price
  • High - High price
  • Low - Low price
  • Close - Closing price
  • Volume - Total contracts traded

Second/Minute quote schema and example data is as follows:

Time Bid Open Bid High Bid Low Bid Close Last Bid Size Ask Open Ask High Ask Low Ask Close Last Ask Size
10920000 1666.5 1666.5 1666.25 1666.25 47 1666.75 1666.75 1666.5 1666.5 37
  • Time - Milliseconds since midnight
  • Bid Open - Opening price for the best bid
  • Bid High - Highest recorded bid price
  • Bid Low - Lowest recorded bid price
  • Bid Close - Closing price for the best bid
  • Last Bid Size - Size of best bid at close
  • Ask Open - Opening price for the best ask
  • Ask High - Highest recorded ask price
  • Ask Low - Lowest recorded ask price
  • Ask Close - Closing price for the best ask
  • Last Ask Size - Size of best ask at close

Second/Minute open interest schema and example data is as follows:

Time Open Interest
42660000 2693575
  • Time - Milliseconds since midnight
  • Open Interest - outstanding contracts

Hour and Daily File Format

Hour/Daily files are located in the future / market / resolution folder. The zip file contains only a single entry.

The zip files have the filename format: symbol_tickType.zip. The CSV file contained within has the filename format: symbol_tickType_symbolExpirationDate.csv

Hour/Daily trades schema and example data is as follows:

Time Open High Low Close Volume
20160601 00:00 43.20 43.50 43.10 43.45 513
  • Time - Formatted as YYYYMMDD HH:mm
  • Open - Opening price
  • High - High price
  • Low - Low price
  • Close - Closing price
  • Volume - Total contracts traded

Hour/Daily quote schema and example data is as follows:

Time Bid Open Bid High Bid Low Bid Close Last Bid Size Ask Open Ask High Ask Low Ask Close Last Ask Size
20170719 00:00 583.20 583.40 583.10 583.40 2932 583.21 583.50 583.11 583.44 392

Hour/Daily open interest schema and example data is as follows:

Time Open Interest
20190203 00:00 3902
  • Time - Formatted as YYYYMMDD HH:mm
  • Open Interest - outstanding contracts

Tick File Format

Tick data is stored in the future / market / tick / symbol folder. The zip file contains multiple csv entries, varying by the symbol's expiration date.

The zip files have the filename format: YYYYMMDD_tickType.zip. The CSV files contained within have the filename format: YYYYMMDD_symbol_tick_tickType_symbolExpirationDate.csv

Tick trades schema and example data is as follows:

Time Last Price Quantity Exchange Sale Condition Suspicious
939243 402.01 203 usa null 0
  • Time - Milliseconds since midnight
  • Last Price - Last traded price
  • Quantity - Amount traded
  • Exchange - Where transaction took place
  • Sale Condition - always null, not used
  • Suspicious - Not used, will always be "0"