Datasets
Databento
Introduction
Instead of using the data from QuantConnect or your brokerage, you can use Databento for historical data if you're deploying a local project. This page explains our integration with their API and its functionality. To use Databento, you need to get an API key.
To view the implementation of the Databento integration, see the Lean.DataSource.Databento repository.
To use the CLI, you must be a member in an organization on a paid tier.
Supported Datasets
The Databento data provider serves asset price data directly from Databento's API. Our integration supports US Futures securities. It only provides the security price data, so you need to download the US Futures Security Master and the US Futures Universe .
Download
To download Databento data, open a terminal in your organization workspace and then run lean data download --data-provider-historical DataBento --data-type Trade --resolution <resolution> --security-type Future --ticker <tickers> --market <market> --start <YYYYMMDD> --end <YYYYMMDD> --databento-api-key <apiKey>.
$ lean data download --data-provider-historical DataBento --data-type Trade --resolution Daily --security-type Future --ticker ESH6,ESM6,ESU6,ESZ6 --market CME --start 20260101 --end 20260213 --databento-api-key apiKey
You must provide all the contracts. For example, ESH6, ESM6, ESU6, ESZ6.
Research
To access Databento data from the local Research Environment, open a terminal in your organization workspace and then run lean research <projectName> --data-provider-historical DataBento --databento-api-key <apiKey>.
$ lean research "My Project" --data-provider-historical DataBento --databento-api-key apiKey
You must download the historical data before running the research environment.
Backtesting
To run a local backtest with DataBento data, open a terminal in your organization workspace and then run lean backtest <projectName> --data-provider-historical DataBento --databento-api-key <apiKey>.
$ lean backtest "My Project" --data-provider-historical DataBento --databento-api-key apiKey
You must download the historical data before running the backtest.
Optimization
Follow these steps to run a local optimization job with Databento data:
- Add some parameters to your project.
- Open a terminal in your organization workspace.
- Run
lean optimize <projectName> --data-provider-historical DataBento --databento-api-key <apiKey>. - Follow the steps in the interactive wizard to configure your optimization job settings.
$ lean optimize "My Project" --data-provider-historical DataBento --databento-api-key apiKey
The lean optimize command also accepts additional options so that you can select Alpha Vantage and run the command in non-interactive mode.
If you provide any of the preceding options, your Lean configuration file saves them so that you only need to run lean optimize <projectName> to run another optimization job with the same options.
You must download the historical data before running the optimization.
Live Trading
To deploy a local live algorithm that uses Databento as the historical and the live data provider, open a terminal in your organization workspace and then run lean live deploy <projectName> --data-provider-historical DataBento --data-provider-live DataBento --databento-api-key <apiKey> --brokerage <brokerageName> <requiredBrokerageOptions>.
$ lean live deploy "My Project" --data-provider-historical DataBento --data-provider-live DataBento --databento-api-key apiKey --brokerage "Paper Trading"
Pricing
To view the prices of the Databento API packages, see the Pricing page on the Databento website.