Skip to content

Data Download Future Options by Ticker #574

Open

Description

@AlexCatarino

The following command doesn't download data:

$ lean data download --dataset "US Future Options" --data-type "trade" --ticker "ES" --market "cme" --resolution "minute" --start "20140101" --end "20250605"

Likely because of FutureOptions directory structure.

LEAN CLI json:

"all": [
                    "futureoption\/{market}\/{resolution}\/{ticker}"
                ]

I tested

"all": [
                    "futureoption\/{market}\/{resolution}\/{ticker}\/{expiry}\/{date}_{data-type}.zip"
                ]

by expiry would be required.

Regex in the database:

/^futureoption\/\w+\/minute\/\w+\/\w+\/[^\/]+\.zip$/m

By the way, LEAN CLI for US Future Option Universe:

$ lean data download --dataset "US Future Option Universe" --data-type "universe" --ticker "ES" --market "cme" --start "20240606" --end "20250606"

doesn't work (needs expiry).

Activity

  1. bbhaught commented on Aug 31, 2025

    @bbhaught

    Not limited to quantconnect data. Same for all brokerages. I ran it for Interactive Brokers and had the same issue. Full terminal output error is:

    Unhandled exception. System.NotImplementedException: Cannot create future option Symbol using this method
    (insufficient information). Use CreateOption(Symbol, ...) instead.
    at QuantConnect.Symbol.Create(String ticker, SecurityType securityType, String market, String alias, Type
    baseDataType) in /LeanCloud/CI.Builder/bin/Release/src/QuantConnect/Lean/Common/Symbol.cs:line 115
    at
    QuantConnect.DownloaderDataProvider.Launcher.Models.BaseDataDownloadConfig.<>c__DisplayClass32_0.b__0(S
    tring ticker) in
    /LeanCloud/CI.Builder/bin/Release/src/QuantConnect/Lean/DownloaderDataProvider/Models/BaseDataDownloadConfig.cs:line
    132
    at System.Linq.Enumerable.IEnumerableSelectIterator2.ToList() at QuantConnect.DownloaderDataProvider.Launcher.Models.BaseDataDownloadConfig.LoadSymbols(Dictionary2 tickers,
    SecurityType securityType, String market) in
    /LeanCloud/CI.Builder/bin/Release/src/QuantConnect/Lean/DownloaderDataProvider/Models/BaseDataDownloadConfig.cs:line
    132
    at QuantConnect.DownloaderDataProvider.Launcher.Models.BaseDataDownloadConfig..ctor() in
    /LeanCloud/CI.Builder/bin/Release/src/QuantConnect/Lean/DownloaderDataProvider/Models/BaseDataDownloadConfig.cs:line
    93
    at QuantConnect.DownloaderDataProvider.Launcher.Models.DataDownloadConfig..ctor() in
    /LeanCloud/CI.Builder/bin/Release/src/QuantConnect/Lean/DownloaderDataProvider/Models/DataDownloadConfig.cs:line 36
    at QuantConnect.DownloaderDataProvider.Launcher.Program.Main(String[] args) in
    /LeanCloud/CI.Builder/bin/Release/src/QuantConnect/Lean/DownloaderDataProvider/Program.cs:line 79
    /lean-cli-start.sh: line 11: 137 Aborted (core dumped) dotnet
    QuantConnect.DownloaderDataProvider.Launcher.dll --data-type Trade --start-date 20250801 --end-date 20250831
    --security-type FutureOption --resolution Daily --tickers ES --market cme

  2. quantconnect-kronos commented on Nov 2, 2026

    @quantconnect-kronos
    Contributor

    I looked into this. Neither half of the report needs a change in the CLI's code.

    QuantConnect provider (--dataset "US Future Options"). The CLI builds the list of files to download from the dataset's path templates, which it receives from QuantConnect. The templates for single tickers don't match how future option data is stored, so no file ever matches:

    • hour/daily: the template is futureoption/{market}/{resolution}/{ticker}_{data-type}.zip, but the files are futureoption/{market}/{resolution}/{ticker}/{contract-month}/{ticker}_{year}_{data-type}_american.zip.
    • minute: the template stops at the {ticker}/{contract-month} folder. The files are futureoption/{market}/minute/{ticker}/{contract-month}/{date}_{data-type}_american.zip. The start and end dates are also only asked for hour and daily, so minute requests never get dates.

    With corrected templates, the CLI's file selection returns the expected files. For example, ES / CME / contract month 202503 / 2025-01-01 to 2025-01-10 gives the daily minute trade zips and es_2025_trade_american.zip for hour and daily. This is a configuration fix on QuantConnect's side, and I've passed it to the team.

    "US Future Option Universe" now takes a contract month and uses futureoption/{market}/universes/{ticker}/{contract-month}/{date}.csv, which matches the data layout.

    Other providers (--security-type FutureOption --tickers ES). The crash comes from Lean's downloader, not the CLI. A plain ES is a canonical future option, and Lean can't build one without a future contract, so it throws Cannot create future option Symbol using this method. Recent Lean versions accept a single future option contract, such as --ticker "ESH25 C5000". Downloading a whole canonical future option chain by ticker, or failing with a clearer message, would be a change in Lean.

  3. quantconnect-kronos commented on Nov 2, 2026

    @quantconnect-kronos
    Contributor

    Correction to my comment above: with current CLI versions, --ticker "ESH25 C5000" doesn't reach the downloader intact. The CLI runs the downloader command through a shell without quoting, so the contract is split at the space. #696 quotes the arguments, so single future option contracts can be downloaded once it's released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions