Datasets

Polygon

Introduction

Polygon was founded by Quinton Pike in 2017 with the goal to "break down the barriers that have traditionally limited access to high-quality financial data for all". Polygon provides institutional-grade Equity, Option, Index, Forex, and Crypto data for business and educational purposes.

To view the implementation of the Polygon integration, see the Lean.DataSource.Polygon repository.

The Polygon data provider streams live asset prices from Polygon. If you use this data provider and request historical data, the historical data comes from Polygon.

Supported Datasets

The Polygon data feed comes directly from Polygon. Our integration supports securities from the following asset classes:

If you use the Polygon data provider, it only provides the security price data, so you need to download the US Equity Security Master with the CLI. For more information about the data source, see the Polygon API documentation.

Universe Selection

Universe Selection is available with the Polygon data provider if you download the data from the Dataset Market. The dataset listings show how to download the universe selection data with the CLI. For live trading, you'll need to periodically download the new data from QuantConnect Cloud, which you can automate with Python scripts. For example, the following tutorials explain how to download historical data and download daily updates:

Alternative Data

If you have licensed alternative data with QuantConnect, it works as expected with the Polygon data provider for research, backtesting, and live trading.

Research

To use Polygon data in the Research Environment on Local Platform, first start the Research Environment with the CLI and request the data you need. All the data you request will be cached in your hard drive, so you can then open the Research Environment with the Local Platform UX and access it.

Backtesting

To run an on-premise backtest on Local Platform with Polygon data, first backtest the algorithm on your local machine with the CLI. All the data your backtest requests will be cached in your hard drive, so you can then run the backtest on-premise with the Local Platform UX and access it.

Optimization

To run an on-premise optimization on Local Platform with Polygon data, first backtest the algorithm on your local machine with the CLI. All the data your backtest requests will be cached in your hard drive, so you can then run the optimization on-premise with the Local Platform UX and access it.

Live Trading

The following sections explain live trading deployment and data updates when using the Polygon data provider.

Deployment

Follow these steps to deploy a live trading algorithm that uses the Polygon data provider:

  1. Open the project that you want to deploy.
  2. Click the Local deploy live icon / Deploy live icon Deploy Live icon.
  3. If you deploy to QuantConnect Cloud, you must have an available live trading node for each live trading algorithm you deploy.

  4. On the Deploy Live page, click the Brokerage field and then click your brokerage from the drop-down menu.
  5. Enter the required brokerage authentication information.
  6. For more information about the required information for each brokerage, see the Deploy Live Algorithms section of your brokerage documentation.

  7. In the Data Provider section of the deployment wizard, click Show.
  8. Click the Data Provider 1 field and then click Polygon from the drop-down menu.
  9. Enter your Polygon API Key.
  10. Polygon selected as the data provider in the deployment wizard
  11. Click Save.
  12. (Optional) If your brokerage supports exisiting cash and position holdings, add them.
  13. (Optional) If you are deploying to QuantConnect Cloud, set up notifications.
  14. Configure the Automatically restart algorithm setting.
  15. By enabling automatic restarts, the algorithm will use best efforts to restart the algorithm if it fails due to a runtime error. This can help improve the algorithm's resilience to temporary outages such as a brokerage API disconnection.

  16. Click Deploy.

Data Updates

If you deploy local live algorithms that trade US Equities or US Equity Options, you'll need to periodically update your US Equity Security Master. Weekly updates are sufficient in most cases.

If you deploy local live algorithms that rely on US Equity universe data, you'll need to download the latest data files every trading day. For an example Python script that updates local US Equity Coarse Universe files, see Download Daily Updates. For an example Python script that updates local US ETF Constituents files, see Download Daily Updates. To update alternative datasets that support universe selection, see the CLI commands in their respective dataset listing.

Pricing

To view the prices of the Polygon API packages, see the Simple Pricing page on the Polygon website.

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: