Data Providers

Theta Data

Introduction

Instead of using the data from your brokerage, you can also use Theta Data if you're deploying a local project. To use Theta Data, you need to install and launch the Theta Terminal. This tutorial demonstrates how to set up the Theta Data data provider with the QuantConnect Paper Trading brokerage.

To view the implementation of the Theta Data integration, see the Lean.DataSource.ThetaData repository.

To use the CLI, you must be a member in an organization on a paid tier.

Deploy Local Algorithms

Follow these steps to start local live trading with the ThetaData data provider:

  1. Log in to the CLI if you haven't done so already.
  2. Open a terminal in the organization workspace that contains the project.
  3. Run lean live deploy "<projectName>" to start a live deployment wizard for the project in . / <projectName> and then enter a brokerage number.
    $ lean live deploy "My Project"
    Select a brokerage:
    1) Paper Trading
    2) Interactive Brokers
    3) Tradier
    4) OANDA
    5) Bitfinex
    6) Coinbase Advanced Trade
    7) Binance
    8) Zerodha
    9) Samco
    10) Terminal Link
    11) Trading Technologies
    12) Kraken
    13) Charles Schwab
    14) Bybit
    15) TradeStation
    16) Alpaca
    Enter an option: 1
  4. Enter the number of the live data provider(s) to use and then follow the steps required for the data connection.
    $ lean live deploy "My Project"
    Select a live data provider:
    1) Interactive Brokers
    2) Tradier
    3) Oanda
    4) Bitfinex
    5) Coinbase Advanced Trade
    6) Binance
    7) Zerodha
    8) Samco
    9) Terminal Link
    10) Trading Technologies
    11) Kraken
    12) Charles Schwab
    13) IQFeed
    14) Polygon
    15) IEX
    16) CoinApi
    17) ThetaData
    18) Custom data only
    19) Bybit
    20) TradeStation
    21) Alpaca
    To enter multiple options, separate them with comma:
  5. (Optional) Enter the host of the ThetaData Client.

    The default host is ws://host.docker.internal:25520/v1/events or http://host.docker.internal:25510.

    $ lean live "My Project"
    The host of ThetaData Client [ws://host.docker.internal:25520/v1/events]:
    The host of ThetaData Client [http://host.docker.internal:25510]:
  6. Enter your Theta Data subscription plan.
    $ lean live "My Project"
    ThetaData subscription price plan (Free, Value, Standard, Pro):
  7. View the result in the <projectName> / live / <timestamp> directory. Results are stored in real-time in JSON format. You can save results to a different directory by providing the --output <path> option in step 2.

If you already have a live environment configured in your Lean configuration file, you can skip the interactive wizard by providing the --environment <value> option in step 2. The value of this option must be the name of an environment which has live-mode set to true.

Deploy Cloud Algorithms

The CLI doesn't currently support deploying cloud algorithms with the Theta Data data provider.

Supported Assets

Our Theta Data integration supports securities from the following asset classes:

Mutiple Data Providers

When you deploy a live algorithm, you can add multiple data providers. If you use multiple data providers, the order you select them in defines their order of precedence in Lean.

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: