Name | lean JSON |
Version |
1.0.211
JSON |
| download |
home_page | https://lean.io/cli |
Summary | A CLI aimed at making it easier to run QuantConnect's LEAN engine locally and in the cloud |
upload_time | 2024-12-18 19:30:39 |
maintainer | None |
docs_url | None |
author | QuantConnect |
requires_python | >=3.7 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
![Lean CLI](http://cdn.quantconnect.com.s3.us-east-1.amazonaws.com/i/github/lean-cli-splash.png)
# QuantConnect Lean CLI
[![Build Status](https://github.com/QuantConnect/lean-cli/workflows/Build/badge.svg)](https://github.com/QuantConnect/lean-cli/actions?query=workflow%3ABuild)
[![PyPI Version](https://img.shields.io/pypi/v/lean)](https://pypi.org/project/lean/)
[![Project Status](https://img.shields.io/pypi/status/lean)](https://pypi.org/project/lean/)
The Lean CLI is a cross-platform CLI aimed at making it easier to develop with the LEAN engine locally and in the cloud.
Visit the [documentation website](https://www.lean.io/docs/v2/lean-cli/key-concepts/getting-started) for comprehensive and up-to-date documentation.
## Highlights
- [Project scaffolding](https://www.lean.io/docs/v2/lean-cli/projects/project-management)
- [Local autocomplete](https://www.lean.io/docs/v2/lean-cli/projects/autocomplete)
- [Local data downloading](https://www.lean.io/docs/v2/lean-cli/datasets/downloading-quantconnect-data)
- [Local backtesting](https://www.lean.io/docs/v2/lean-cli/backtesting/deployment#02-Run-Local-Backtests)
- [Local debugging](https://www.lean.io/docs/v2/lean-cli/backtesting/debugging)
- [Local research environment](https://www.lean.io/docs/v2/lean-cli/research)
- [Local optimization](https://www.lean.io/docs/v2/lean-cli/optimization/deployment#02-Run-Local-Optimizations)
- [Local live trading](https://www.lean.io/docs/v2/lean-cli/live-trading/quantconnect-paper-trading#02-Deploy-Local-Algorithms)
- [Local backtest report creation](https://www.lean.io/docs/v2/lean-cli/backtesting/report#02-Generate-a-Report)
- [Cloud synchronization](https://www.lean.io/docs/v2/lean-cli/projects/cloud-synchronization)
- [Cloud backtesting](https://www.lean.io/docs/v2/lean-cli/backtesting/deployment#03-Run-Cloud-Backtests)
- [Cloud optimization](https://www.lean.io/docs/v2/lean-cli/optimization/deployment#03-Run-Cloud-Optimizations)
- [Cloud live trading](https://www.lean.io/docs/v2/lean-cli/live-trading/quantconnect-paper-trading#03-Deploy-Cloud-Algorithms)
## Installation
The CLI can be installed and updated by running `pip install --upgrade lean`.
Note that many commands in the CLI require Docker to run. See [Get Docker](https://docs.docker.com/get-docker/) for instructions on how to install Docker for your operating system.
**Note:** Some Linux users may need to install `tkinter` using the following commands:
```
For Python 3
sudo apt-get install python3-tk
For Python 2.7
sudo apt-get install python-tk
```
After installing the CLI, open a terminal in an empty directory and run `lean init`. This command downloads the latest configuration file and sample data from the [QuantConnect/Lean](https://github.com/QuantConnect/Lean) repository. We recommend running all Lean CLI commands in the same directory `lean init` was ran in.
## Usage
The Lean CLI supports multiple workflows. The examples below serve as a starting point, you're free to mix local and cloud features in any way you'd like.
A cloud-focused workflow (local development, cloud execution) with the CLI may look like this:
1. Open a terminal in the directory you ran `lean init` in.
2. Run `lean cloud pull` to pull remotely changed files.
3. Start programming locally and run backtests in the cloud with `lean cloud backtest "Project Name" --open --push` whenever there is something to backtest. The `--open` flag means that the backtest results will be opened in the browser when done, while the `--push` flag means that local changes are pushed to the cloud before running the backtest.
4. Whenever you want to create a new project, run `lean create-project "Project Name"` and `lean cloud push --project "Project Name"` to create a new project containing some basic code and to push it to the cloud.
5. When you're finished for the moment, run `lean cloud push` to push all locally changed files to the cloud.
A locally-focused workflow (local development, local execution) with the CLI may look like this:
1. Open a terminal in the directory you ran `lean init` in.
2. Run `lean create-project "Project Name"` to create a new project with some basic code to get you started.
3. Work on your strategy in `./Project Name`.
4. Run `lean research "Project Name"` to start a Jupyter Lab session to perform research in.
5. Run `lean backtest "Project Name"` to run a backtest whenever there's something to test. This runs your strategy in a Docker container containing the same packages as the ones used on QuantConnect.com, but with your own data.
## Commands
*Note: the readme only contains the `--help` text of all commands. Visit the [documentation website](https://www.lean.io/docs/v2/lean-cli/key-concepts/getting-started) for more comprehensive documentation.*
<!-- commands start -->
- [`lean backtest`](#lean-backtest)
- [`lean build`](#lean-build)
- [`lean cloud backtest`](#lean-cloud-backtest)
- [`lean cloud live`](#lean-cloud-live)
- [`lean cloud live command`](#lean-cloud-live-command)
- [`lean cloud live deploy`](#lean-cloud-live-deploy)
- [`lean cloud live liquidate`](#lean-cloud-live-liquidate)
- [`lean cloud live stop`](#lean-cloud-live-stop)
- [`lean cloud object-store delete`](#lean-cloud-object-store-delete)
- [`lean cloud object-store get`](#lean-cloud-object-store-get)
- [`lean cloud object-store list`](#lean-cloud-object-store-list)
- [`lean cloud object-store ls`](#lean-cloud-object-store-ls)
- [`lean cloud object-store properties`](#lean-cloud-object-store-properties)
- [`lean cloud object-store set`](#lean-cloud-object-store-set)
- [`lean cloud optimize`](#lean-cloud-optimize)
- [`lean cloud pull`](#lean-cloud-pull)
- [`lean cloud push`](#lean-cloud-push)
- [`lean cloud status`](#lean-cloud-status)
- [`lean config get`](#lean-config-get)
- [`lean config list`](#lean-config-list)
- [`lean config set`](#lean-config-set)
- [`lean config unset`](#lean-config-unset)
- [`lean create-project`](#lean-create-project)
- [`lean data download`](#lean-data-download)
- [`lean data generate`](#lean-data-generate)
- [`lean decrypt`](#lean-decrypt)
- [`lean delete-project`](#lean-delete-project)
- [`lean encrypt`](#lean-encrypt)
- [`lean init`](#lean-init)
- [`lean library add`](#lean-library-add)
- [`lean library remove`](#lean-library-remove)
- [`lean live`](#lean-live)
- [`lean live add-security`](#lean-live-add-security)
- [`lean live cancel-order`](#lean-live-cancel-order)
- [`lean live command`](#lean-live-command)
- [`lean live deploy`](#lean-live-deploy)
- [`lean live liquidate`](#lean-live-liquidate)
- [`lean live stop`](#lean-live-stop)
- [`lean live submit-order`](#lean-live-submit-order)
- [`lean live update-order`](#lean-live-update-order)
- [`lean login`](#lean-login)
- [`lean logout`](#lean-logout)
- [`lean logs`](#lean-logs)
- [`lean object-store delete`](#lean-object-store-delete)
- [`lean object-store get`](#lean-object-store-get)
- [`lean object-store list`](#lean-object-store-list)
- [`lean object-store ls`](#lean-object-store-ls)
- [`lean object-store properties`](#lean-object-store-properties)
- [`lean object-store set`](#lean-object-store-set)
- [`lean optimize`](#lean-optimize)
- [`lean private-cloud add-compute`](#lean-private-cloud-add-compute)
- [`lean private-cloud start`](#lean-private-cloud-start)
- [`lean private-cloud stop`](#lean-private-cloud-stop)
- [`lean project-create`](#lean-project-create)
- [`lean project-delete`](#lean-project-delete)
- [`lean report`](#lean-report)
- [`lean research`](#lean-research)
- [`lean whoami`](#lean-whoami)
### `lean backtest`
Backtest a project locally using Docker.
```
Usage: lean backtest [OPTIONS] PROJECT
Backtest a project locally using Docker.
If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.
If PROJECT is a file, the algorithm in the specified file will be executed.
Go to the following url to learn how to debug backtests locally using the Lean CLI:
https://www.lean.io/docs/v2/lean-cli/backtesting/debugging
By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you
can set the default engine image for all commands using `lean config set engine-image <image>`.
Options:
--output DIRECTORY Directory to store results in (defaults to PROJECT/backtests/TIMESTAMP)
-d, --detach Run the backtest in a detached Docker container and return immediately
--debug [pycharm|ptvsd|debugpy|vsdbg|rider|local-platform]
Enable a certain debugging method (see --help for more information)
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
--ib-password TEXT Your Interactive Brokers password
--ib-weekly-restart-utc-time TEXT
Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at
this time, and will require 2FA verification. This is required by Interactive Brokers.
Use this option explicitly to override the default value. (Optional).
--oanda-account-id TEXT Your OANDA account id
--oanda-access-token TEXT Your OANDA API token
--oanda-environment [Practice|Trade]
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
--binanceus-api-key TEXT Your Binance API key
--binance-api-secret TEXT Your Binance API secret
--binanceus-api-secret TEXT Your Binance API secret
--kraken-api-key TEXT Your Kraken API key
--kraken-api-secret TEXT Your Kraken API secret
--kraken-verification-tier [Starter|Intermediate|Pro]
Your Kraken Verification Tier
--iqfeed-iqconnect TEXT The path to the IQConnect binary
--iqfeed-username TEXT Your IQFeed username
--iqfeed-password TEXT Your IQFeed password
--iqfeed-version TEXT The product version of your IQFeed developer account
--iqfeed-host TEXT The IQFeed host address (Optional).
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
--thetadata-ws-url TEXT The ThetaData host address (Optional).
--thetadata-rest-url TEXT The ThetaData host address (Optional).
--thetadata-subscription-plan [Free|Value|Standard|Pro]
Your ThetaData subscription price plan
--terminal-link-connection-type [DAPI|SAPI]
Terminal Link Connection Type [DAPI, SAPI]
--terminal-link-environment [Production|Beta]
The environment to run in
--terminal-link-server-host TEXT
The host of the TerminalLink server
--terminal-link-server-port INTEGER
The port of the TerminalLink server
--terminal-link-openfigi-api-key TEXT
The Open FIGI API key to use for mapping options
--terminal-link-server-auth-id TEXT
The Auth ID of the TerminalLink server
--bybit-api-key TEXT Your Bybit API key
--bybit-api-secret TEXT Your Bybit API secret
--trade-station-environment [live|paper]
Whether Live or Paper environment should be used
--trade-station-account-id TEXT
The TradeStation account Id
--alpaca-environment [live|paper]
Whether Live or Paper environment should be used
--download-data Update the Lean configuration file to download data from the QuantConnect API, alias
for --data-provider-historical QuantConnect
--data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the backtest when using
QuantConnect as historical data provider
--release Compile C# projects in release configuration instead of debug
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
--python-venv TEXT The path of the python virtual environment to be used
--update Pull the LEAN engine image before running the backtest
--backtest-name TEXT Backtest name
--extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-
py.readthedocs.io/en/stable/containers.html
--no-update Use the local LEAN engine image instead of pulling the latest version
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/backtest.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/backtest.py)_
### `lean build`
Build Docker images of your own version of LEAN.
```
Usage: lean build [OPTIONS] [ROOT]
Build Docker images of your own version of LEAN.
ROOT must point to a directory containing the LEAN repository:
https://github.com/QuantConnect/Lean
When ROOT is not given, the current directory is used as root directory.
This command performs the following actions:
1. The lean-cli/foundation:latest image is built from Lean/DockerfileLeanFoundation(ARM).
2. LEAN is compiled in a Docker container using the lean-cli/foundation:latest image.
3. The lean-cli/engine:latest image is built from Lean/Dockerfile using lean-cli/foundation:latest as base image.
4. The lean-cli/research:latest image is built from Lean/DockerfileJupyter using lean-cli/engine:latest as base image.
5. The default engine image is set to lean-cli/engine:latest.
6. The default research image is set to lean-cli/research:latest.
When the foundation Dockerfile is the same as the official foundation Dockerfile, quantconnect/lean:foundation is used
instead of building a custom foundation image.
Options:
--tag TEXT The tag to apply to custom images (defaults to latest)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/build.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/build.py)_
### `lean cloud backtest`
Backtest a project in the cloud.
```
Usage: lean cloud backtest [OPTIONS] PROJECT
Backtest a project in the cloud.
PROJECT must be the name or id of the project to run a backtest for.
If the project that has to be backtested has been pulled to the local drive with `lean cloud pull` it is possible to
use the --push option to push local modifications to the cloud before running the backtest.
Options:
--name TEXT The name of the backtest (a random one is generated if not specified)
--push Push local modifications to the cloud before running the backtest
--open Automatically open the results in the browser when the backtest is finished
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/backtest.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/backtest.py)_
### `lean cloud live`
Interact with the QuantConnect cloud live deployments.
```
Usage: lean cloud live [OPTIONS] COMMAND [ARGS]...
Interact with the QuantConnect cloud live deployments.
Options:
--help Show this message and exit.
Commands:
command Send a command to a running cloud live trading project.
deploy Start live trading for a project in the cloud.
liquidate Stops live trading and liquidates existing positions for a certain project.
stop Stops live trading for a certain project without liquidating existing positions.
```
### `lean cloud live command`
Send a command to a running cloud live trading project.
```
Usage: lean cloud live command [OPTIONS] PROJECT
Send a command to a running cloud live trading project.
Options:
--data TEXT The command to send, 'str' representation of a 'dict' e.g. "{ \"target\": \"BTCUSD\",
\"$type\":\"MyCommand\" }"
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/live/command.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/command.py)_
### `lean cloud live deploy`
Start live trading for a project in the cloud.
```
Usage: lean cloud live deploy [OPTIONS] PROJECT
Start live trading for a project in the cloud.
PROJECT must be the name or the id of the project to start live trading for.
By default an interactive wizard is shown letting you configure the deployment. If --brokerage is given the command
runs in non-interactive mode. In this mode the CLI does not prompt for input or confirmation. In non-interactive mode
the options specific to the given brokerage are required, as well as --node, --auto-restart, --notify-order-events and
--notify-insights.
Options:
--brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|Bybit|TradeStation|Alpaca]
The brokerage to use
--data-provider-live [QuantConnect|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|Polygon|IEX|CoinApi|Bybit|TradeStation|Alpaca]
The live data provider to use
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
--ib-password TEXT Your Interactive Brokers password
--ib-weekly-restart-utc-time TEXT
Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at
this time, and will require 2FA verification. This is required by Interactive Brokers.
Use this option explicitly to override the default value. (Optional).
--tradier-account-id TEXT Your Tradier account id
--tradier-access-token TEXT Your Tradier access token
--tradier-environment [live|paper]
Whether the developer sandbox should be used
--oanda-account-id TEXT Your OANDA account id
--oanda-access-token TEXT Your OANDA API token
--oanda-environment [Practice|Trade]
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
--binanceus-api-key TEXT Your Binance API key
--binance-api-secret TEXT Your Binance API secret
--binanceus-api-secret TEXT Your Binance API secret
--binance-use-testnet [live|paper]
Whether the testnet should be used
--zerodha-api-key TEXT Your Kite Connect API key
--zerodha-access-token TEXT Your Kite Connect access token
--zerodha-product-type [mis|cnc|nrml]
MIS if you are targeting intraday products, CNC if you are targeting delivery
products, NRML if you are targeting carry forward products
--zerodha-trading-segment [equity|commodity]
EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading
commodities on MCX
--zerodha-history-subscription [true|false]
Whether you have a history API subscription for Zerodha
--samco-client-id TEXT Your Samco account Client ID
--samco-client-password TEXT Your Samco account password
--samco-year-of-birth TEXT Your year of birth (YYYY) registered with Samco
--samco-product-type [mis|cnc|nrml]
MIS if you are targeting intraday products, CNC if you are targeting delivery
products, NRML if you are targeting carry forward products
--samco-trading-segment [equity|commodity]
EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading
commodities on MCX
--terminal-link-server-auth-id TEXT
The Auth ID of the TerminalLink server
--terminal-link-environment [Production|Beta]
The environment to run in
--terminal-link-server-host TEXT
The host of the SAPI server
--terminal-link-server-port INTEGER
The port of the SAPI server
--terminal-link-emsx-broker TEXT
The EMSX broker to use (Optional).
--terminal-link-emsx-account TEXT
The EMSX account to use (Optional).
--terminal-link-emsx-team TEXT The EMSX team to receive order events from (Optional).
--terminal-link-openfigi-api-key TEXT
The Open FIGI API key to use for mapping options
--tt-user-name TEXT Your Trading Technologies username
--tt-session-password TEXT Your Trading Technologies session password
--tt-account-name TEXT Your Trading Technologies account name
--tt-rest-app-key TEXT Your Trading Technologies REST app key
--tt-rest-app-secret TEXT Your Trading Technologies REST app secret
--tt-rest-environment TEXT The REST environment to run in
--tt-order-routing-sender-comp-id TEXT
The order routing sender comp id to use
--kraken-api-key TEXT Your Kraken API key
--kraken-api-secret TEXT Your Kraken API secret
--kraken-verification-tier [Starter|Intermediate|Pro]
Your Kraken Verification Tier
--tdameritrade-api-key TEXT Your TDAmeritrade API key
--tdameritrade-access-token TEXT
Your TDAmeritrade OAuth Access Token
--tdameritrade-account-number TEXT
Your TDAmeritrade account number
--bybit-api-key TEXT Your Bybit API key
--bybit-api-secret TEXT Your Bybit API secret
--bybit-vip-level [VIP0|VIP1|VIP2|VIP3|VIP4|VIP5|SupremeVIP|Pro1|Pro2|Pro3|Pro4|Pro5]
Your Bybit VIP Level
--trade-station-environment [live|paper]
Whether Live or Paper environment should be used
--trade-station-account-id TEXT
The TradeStation account Id
--alpaca-environment [live|paper]
Whether Live or Paper environment should be used
--polygon-api-key TEXT Your Polygon.io API Key
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
--alpaca-api-key TEXT Your Alpaca Api Key
--alpaca-api-secret TEXT Your Alpaca Api Secret
--node TEXT The name or id of the live node to run on
--auto-restart BOOLEAN Whether automatic algorithm restarting must be enabled
--notify-order-events BOOLEAN Whether notifications must be sent for order events
--notify-insights BOOLEAN Whether notifications must be sent for emitted insights
--notify-emails TEXT A comma-separated list of 'email:subject' pairs configuring email-notifications
--notify-webhooks TEXT A comma-separated list of 'url:HEADER_1=VALUE_1:HEADER_2=VALUE_2:etc' pairs
configuring webhook-notifications
--notify-sms TEXT A comma-separated list of phone numbers configuring SMS-notifications
--notify-telegram TEXT A comma-separated list of 'user/group Id:token(optional)' pairs configuring telegram-
notifications
--live-cash-balance TEXT A comma-separated list of currency:amount pairs of initial cash balance
--live-holdings TEXT A comma-separated list of symbol:symbolId:quantity:averagePrice of initial portfolio
holdings
--push Push local modifications to the cloud before starting live trading
--open Automatically open the live results in the browser once the deployment starts
--show-secrets Show secrets as they are input
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/live/deploy.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/deploy.py)_
### `lean cloud live liquidate`
Stops live trading and liquidates existing positions for a certain project.
```
Usage: lean cloud live liquidate [OPTIONS] PROJECT
Stops live trading and liquidates existing positions for a certain project.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/live/liquidate.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/liquidate.py)_
### `lean cloud live stop`
Stops live trading for a certain project without liquidating existing positions.
```
Usage: lean cloud live stop [OPTIONS] PROJECT
Stops live trading for a certain project without liquidating existing positions.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/live/stop.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/stop.py)_
### `lean cloud object-store delete`
Delete a value from the organization's cloud object store.
```
Usage: lean cloud object-store delete [OPTIONS] KEY
Delete a value from the organization's cloud object store.
:param key: The desired key name to delete.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/object_store/delete.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/delete.py)_
### `lean cloud object-store get`
Download an object store value to disk from the organization's cloud object store.
```
Usage: lean cloud object-store get [OPTIONS] [KEY]...
Download an object store value to disk from the organization's cloud object store.
:param key: The desired key to fetch, multiple can be provided.
Options:
--destination-folder TEXT The destination folder to download the object store values, if not provided will use to
current directory
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/object_store/get.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/get.py)_
### `lean cloud object-store list`
List all values for the given root key in the organization's cloud object store.
```
Usage: lean cloud object-store list [OPTIONS] [KEY]
List all values for the given root key in the organization's cloud object store.
:param key: The desired root key to list.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/object_store/list.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/list.py)_
### `lean cloud object-store ls`
Alias for 'list'
```
Usage: lean cloud object-store ls [OPTIONS] [KEY]
List all values for the given root key in the organization's cloud object store.
:param key: The desired root key to list.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/object_store/ls.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/ls.py)_
### `lean cloud object-store properties`
Get a value properties from the organization's cloud object store.
```
Usage: lean cloud object-store properties [OPTIONS] KEY
Get a value properties from the organization's cloud object store.
:param key: The desired key to fetch the properties for.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/object_store/properties.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/properties.py)_
### `lean cloud object-store set`
Sets the data to the given key in the organization's cloud object store.
```
Usage: lean cloud object-store set [OPTIONS] KEY PATH
Sets the data to the given key in the organization's cloud object store.
:param key: The key to set the data to. :param path: Path to the file containing the object data.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/object_store/set.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/set.py)_
### `lean cloud optimize`
Optimize a project in the cloud.
```
Usage: lean cloud optimize [OPTIONS] PROJECT
Optimize a project in the cloud.
PROJECT must be the name or id of the project to optimize.
An interactive prompt will be shown to configure the optimizer. If --target is given the command runs in non-
interactive mode. In this mode the CLI does not prompt for input and the following options become required: --target,
--target-direction, --parameter, --node and --parallel-nodes.
In non-interactive mode the --parameter option can be provided multiple times to configure multiple parameters:
- --parameter <name> <min value> <max value> <step size>
- --parameter my-first-parameter 1 10 0.5 --parameter my-second-parameter 20 30 5
In non-interactive mode the --constraint option can be provided multiple times to configure multiple constraints:
- --constraint "<statistic> <operator> <value>"
- --constraint "Sharpe Ratio >= 0.5" --constraint "Drawdown < 0.25"
If the project that has to be optimized has been pulled to the local drive with `lean cloud pull` it is possible to
use the --push option to push local modifications to the cloud before running the optimization.
Options:
--target TEXT The target statistic of the optimization
--target-direction [min|max] Whether the target must be minimized or maximized
--parameter <TEXT FLOAT FLOAT FLOAT>...
The 'parameter min max step' pairs configuring the parameters to optimize
--constraint TEXT The 'statistic operator value' pairs configuring the constraints of the optimization
--node [O2-8|O4-12|O8-16] The node type to run the optimization on
--parallel-nodes INTEGER The number of nodes that may be run in parallel
--name TEXT The name of the optimization (a random one is generated if not specified)
--push Push local modifications to the cloud before starting the optimization
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/optimize.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/optimize.py)_
### `lean cloud pull`
Pull projects from QuantConnect to the local drive.
```
Usage: lean cloud pull [OPTIONS]
Pull projects from QuantConnect to the local drive.
This command overrides the content of local files with the content of their respective counterparts in the cloud.
This command will not delete local files for which there is no counterpart in the cloud.
Options:
--project TEXT Name or id of the project to pull (all cloud projects if not specified)
--pull-bootcamp Pull Boot Camp projects (disabled by default)
--encrypt Pull your cloud files and encrypt them before saving on your local drive
--decrypt Pull your cloud files and decrypt them before saving on your local drive
--key FILE Path to the encryption key to use
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/pull.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/pull.py)_
### `lean cloud push`
Push local projects to QuantConnect.
```
Usage: lean cloud push [OPTIONS]
Push local projects to QuantConnect.
This command overrides the content of cloud files with the content of their respective local counterparts.
This command will delete cloud files which don't have a local counterpart.
Options:
--project DIRECTORY Path to the local project to push (all local projects if not specified)
--encrypt Push your local files and encrypt them before saving on the cloud
--decrypt Push your local files and decrypt them before saving on the cloud
--key FILE Path to the encryption key to use
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/push.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/push.py)_
### `lean cloud status`
Show the live trading status of a project in the cloud.
```
Usage: lean cloud status [OPTIONS] PROJECT
Show the live trading status of a project in the cloud.
PROJECT must be the name or the id of the project to show the status for.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/cloud/status.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/status.py)_
### `lean config get`
Get the current value of a configurable option.
```
Usage: lean config get [OPTIONS] KEY
Get the current value of a configurable option.
Sensitive options like credentials cannot be retrieved this way for security reasons. Please open ~/.lean/credentials
if you want to see your currently stored credentials.
Run `lean config list` to show all available options.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/config/get.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/get.py)_
### `lean config list`
List the configurable options and their current values.
```
Usage: lean config list [OPTIONS]
List the configurable options and their current values.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/config/list.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/list.py)_
### `lean config set`
Set a configurable option.
```
Usage: lean config set [OPTIONS] KEY VALUE
Set a configurable option.
Run `lean config list` to show all available options.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/config/set.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/set.py)_
### `lean config unset`
Unset a configurable option.
```
Usage: lean config unset [OPTIONS] KEY
Unset a configurable option.
Run `lean config list` to show all available options.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/config/unset.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/unset.py)_
### `lean create-project`
Alias for 'project-create'
```
Usage: lean create-project [OPTIONS] NAME
Create a new project containing starter code.
If NAME is a path containing subdirectories those will be created automatically.
The default language can be set using `lean config set default-language python/csharp`.
Options:
-l, --language [python|csharp] The language of the project to create
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/create_project.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/create_project.py)_
### `lean data download`
Purchase and download data directly from QuantConnect or download from Support Data Providers
```
Usage: lean data download [OPTIONS]
Purchase and download data directly from QuantConnect or download from Support Data Providers
1. Acquire Data from QuantConnect Datasets: Purchase and seamlessly download data directly from QuantConnect.
2. Streamlined Access from Support Data Providers:
- Choose your preferred historical data provider.
- Initiate hassle-free downloads from our supported providers.
We have 2 options:
- interactive (follow instruction in lean-cli)
- no interactive (write arguments in command line)
An interactive wizard will show to walk you through the process of selecting data, accepting the CLI API Access and
Data Agreement and payment. After this wizard the selected data will be downloaded automatically.
If --dataset is given the command runs in non-interactive mode. In this mode the CLI does not prompt for input or
confirmation but only halts when the agreement must be accepted. In non-interactive mode all options specific to the
selected dataset are required.
See the following url for the data that can be purchased and downloaded with this command:
https://www.quantconnect.com/datasets
Options:
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
The name of the downloader data provider.
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
--ib-password TEXT Your Interactive Brokers password
--ib-weekly-restart-utc-time TEXT
Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at
this time, and will require 2FA verification. This is required by Interactive Brokers.
Use this option explicitly to override the default value. (Optional).
--oanda-account-id TEXT Your OANDA account id
--oanda-access-token TEXT Your OANDA API token
--oanda-environment [Practice|Trade]
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
--binanceus-api-key TEXT Your Binance API key
--binance-api-secret TEXT Your Binance API secret
--binanceus-api-secret TEXT Your Binance API secret
--kraken-api-key TEXT Your Kraken API key
--kraken-api-secret TEXT Your Kraken API secret
--kraken-verification-tier [Starter|Intermediate|Pro]
Your Kraken Verification Tier
--iqfeed-iqconnect TEXT The path to the IQConnect binary
--iqfeed-username TEXT Your IQFeed username
--iqfeed-password TEXT Your IQFeed password
--iqfeed-version TEXT The product version of your IQFeed developer account
--iqfeed-host TEXT The IQFeed host address (Optional).
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
--thetadata-ws-url TEXT The ThetaData host address (Optional).
--thetadata-rest-url TEXT The ThetaData host address (Optional).
--thetadata-subscription-plan [Free|Value|Standard|Pro]
Your ThetaData subscription price plan
--terminal-link-connection-type [DAPI|SAPI]
Terminal Link Connection Type [DAPI, SAPI]
--terminal-link-environment [Production|Beta]
The environment to run in
--terminal-link-server-host TEXT
The host of the TerminalLink server
--terminal-link-server-port INTEGER
The port of the TerminalLink server
--terminal-link-openfigi-api-key TEXT
The Open FIGI API key to use for mapping options
--terminal-link-server-auth-id TEXT
The Auth ID of the TerminalLink server
--bybit-api-key TEXT Your Bybit API key
--bybit-api-secret TEXT Your Bybit API secret
--trade-station-environment [live|paper]
Whether Live or Paper environment should be used
--trade-station-account-id TEXT
The TradeStation account Id
--alpaca-environment [live|paper]
Whether Live or Paper environment should be used
--dataset TEXT The name of the dataset to download non-interactively
--overwrite Overwrite existing local data
-y, --yes Automatically confirm payment confirmation prompts
--data-type [Trade|Quote|Bulk|OpenInterest]
Specify the type of historical data
--resolution [Tick|Second|Minute|Hour|Daily]
Specify the resolution of the historical data
--security-type [Equity|Index|Forex|Cfd|Future|Crypto|CryptoFuture|Option|IndexOption|Commodity|FutureOption]
Specify the security type of the historical data
--market TEXT Specify the market name for tickers (e.g., 'USA', 'NYMEX', 'Binance') (if not provided
or empty the default market for the requested security type will be used)
--ticker TEXT Specify comma separated list of tickers to use for historical data request.
--start TEXT Specify the start date for the historical data request in the format yyyyMMdd.
--end TEXT Specify the end date for the historical data request in the format yyyyMMdd. (defaults
to today)
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
--update Pull the LEAN engine image before running the Downloader Data Provider
--no-update Use the local LEAN engine image instead of pulling the latest version
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/data/download.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/data/download.py)_
### `lean data generate`
Generate random market data.
```
Usage: lean data generate [OPTIONS]
Generate random market data.
This uses the random data generator in LEAN to generate realistic market data using a Brownian motion model.
This generator supports the following security types, tick types and resolutions:
| Security type | Generated tick types | Supported resolutions |
| ------------- | -------------------- | ------------------------------------ |
| Equity | Trade | Tick, Second, Minute, Hour and Daily |
| Forex | Quote | Tick, Second, Minute, Hour and Daily |
| CFD | Quote | Tick, Second, Minute, Hour and Daily |
| Future | Trade and Quote | Tick, Second, Minute, Hour and Daily |
| Crypto | Trade and Quote | Tick, Second, Minute, Hour and Daily |
| Option | Trade and Quote | Minute |
The following data densities are available:
- Dense: at least one data point per resolution step.
- Sparse: at least one data point per 5 resolution steps.
- VerySparse: at least one data point per 50 resolution steps.
Example which generates minute data for 100 equity symbols since 2015-01-01:
$ lean data generate --start=20150101 --symbol-count=100
Example which generates daily data for 100 crypto symbols since 2015-01-01:
$ lean data generate --start=20150101 --symbol-count=100 --security-type=Crypto --resolution=Daily
By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you
can set the default engine image for all commands using `lean config set engine-image <image>`.
Options:
--start [yyyyMMdd] Start date for the data to generate in yyyyMMdd format [required]
--end [yyyyMMdd] End date for the data to generate in yyyyMMdd format (defaults to today)
--symbol-count INTEGER RANGE The number of symbols to generate data for [x>=0]
--tickers TEXT Comma separated list of tickers to use for generated data
--security-type [Equity|Forex|Cfd|Future|Crypto|Option]
The security type to generate data for (defaults to Equity)
--resolution [Tick|Second|Minute|Hour|Daily]
The resolution of the generated data (defaults to Minute)
--data-density [Dense|Sparse|VerySparse]
The density of the generated data (defaults to Dense)
--include-coarse BOOLEAN Whether coarse universe data should be generated for Equity data (defaults to True)
--market TEXT The market to generate data for (defaults to standard market for the security type)
--quote-trade-ratio FLOAT The ratio of generated quotes to generated trades. Values larger than 1 mean more
quotes than trades. Only used for Option, Future and Crypto (defaults to 1)
--random-seed INTEGER RANGE The random number generator seed. Defaults to None, which means no seed will be used
[x>=0]
--ipo-percentage FLOAT The probability each equity generated will have an IPO event. Note that this is not
the total probability for all symbols generated. Only used for Equity (defaults to
5.0)
--rename-percentage FLOAT The probability each equity generated will have a rename event. Note that this is not
the total probability for all symbols generated. Only used for Equity (defaults to
30.0)
--splits-percentage FLOAT The probability each equity generated will have a stock split event. Note that this is
not the total probability for all symbols generated. Only used for Equity (defaults to
15.0)
--dividends-percentage FLOAT The probability each equity generated will have dividends. Note that this is not the
probability for all symbols genearted. Only used for Equity (defaults to 60.0)
--dividend-every-quarter-percentage FLOAT
The probability each equity generated will have a dividend event every quarter. Note
that this is not the total probability for all symbols generated. Only used for Equity
(defaults to 30.0)
--option-price-engine TEXT The stochastic process, and returns new pricing engine to run calculations for that
option (defaults to BaroneAdesiWhaleyApproximationEngine)
--volatility-model-resolution [Tick|Second|Minute|Hour|Daily]
The volatility model period span (defaults to Daily)
--chain-symbol-count INTEGER RANGE
The size of the option chain (defaults to 10) [x>=0]
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
--update Pull the LEAN engine image before running the generator
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/data/generate.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/data/generate.py)_
### `lean decrypt`
Decrypt your local project using the specified decryption key.
```
Usage: lean decrypt [OPTIONS] PROJECT
Decrypt your local project using the specified decryption key.
Options:
--key FILE Path to the decryption key to use
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/decrypt.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/decrypt.py)_
### `lean delete-project`
Alias for 'project-delete'
```
Usage: lean delete-project [OPTIONS] PROJECT
Delete a project locally and in the cloud if it exists.
The project is selected by name or cloud id.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/delete_project.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/delete_project.py)_
### `lean encrypt`
Encrypt your local project using the specified encryption key.
```
Usage: lean encrypt [OPTIONS] PROJECT
Encrypt your local project using the specified encryption key.
Options:
--key FILE Path to the encryption key to use
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/encrypt.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/encrypt.py)_
### `lean init`
Scaffold a Lean configuration file and data directory.
```
Usage: lean init [OPTIONS]
Scaffold a Lean configuration file and data directory.
Options:
--organization TEXT The name or id of the organization the Lean CLI will be scaffolded for
-l, --language [python|csharp] The default language to use for new projects
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/init.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/init.py)_
### `lean library add`
Add a custom library to a project.
```
Usage: lean library add [OPTIONS] PROJECT NAME
Add a custom library to a project.
PROJECT must be the path to the project.
NAME must be either the name of a NuGet package (for C# projects), a PyPI package (for Python projects), or a path to
a Lean CLI library.
If --version is not given, and the library is a NuGet or PyPI package the package, it is pinned to the latest
compatible version. For C# projects, this is the latest available version. For Python projects, this is the latest
version compatible with Python 3.8 (which is what the Docker images use). For Lean CLI library projects, this is
ignored.
Custom C# libraries are added to your project's .csproj file, which is then restored if dotnet is on your PATH and the
--no-local flag has not been given.
Custom Python libraries are added to your project's requirements.txt file and are installed in your local Python
environment so you get local autocomplete for the library. The last step can be skipped with the --no-local flag.
C# example usage:
$ lean library add "My CSharp Project" Microsoft.ML
$ lean library add "My CSharp Project" Microsoft.ML --version 1.5.5
$ lean library add "My CSharp Project" "Library/My CSharp Library"
Python example usage:
$ lean library add "My Python Project" tensorflow
$ lean library add "My Python Project" tensorflow --version 2.5.0
$ lean library add "My Python Project" "Library/My Python Library"
Options:
--version TEXT The version of the library to add (defaults to latest compatible version)
--no-local Skip making changes to your local environment
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/library/add.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/library/add.py)_
### `lean library remove`
Remove a custom library from a project.
```
Usage: lean library remove [OPTIONS] PROJECT NAME
Remove a custom library from a project.
PROJECT must be the path to the project directory.
NAME must be either the name of the NuGet package (for C# projects), the PyPI package (for Python projects), or the
path to the Lean CLI library to remove.
Custom C# libraries are removed from the project's .csproj file, which is then restored if dotnet is on your PATH and
the --no-local flag has not been given.
Custom Python libraries are removed from the project's requirements.txt file.
C# example usage:
$ lean library remove "My CSharp Project" Microsoft.ML
Python example usage:
$ lean library remove "My Python Project" tensorflow
Options:
--no-local Skip making changes to your local environment
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/library/remove.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/library/remove.py)_
### `lean live`
Interact with the local machine.
```
Usage: lean live [OPTIONS] COMMAND [ARGS]...
Interact with the local machine.
Options:
--help Show this message and exit.
Commands:
add-security Represents a command to add a security to the algorithm.
cancel-order Represents a command to cancel a specific order by id.
command Send a command to a local running live trading project.
deploy Start live trading a project locally using Docker.
liquidate Liquidate the given symbol from the latest deployment of the given project.
stop Stop an already running local live trading project.
submit-order Represents a command to submit an order to the algorithm.
update-order Represents a command to update a specific order by id.
```
### `lean live add-security`
Represents a command to add a security to the algorithm.
```
Usage: lean live add-security [OPTIONS] PROJECT
Represents a command to add a security to the algorithm.
Options:
--ticker TEXT The ticker of the symbol to add [required]
--market TEXT The market of the symbol to add [required]
--security-type TEXT The security type of the symbol to add [required]
--resolution TEXT The resolution of the symbol to add
--fill-data-forward The fill forward behavior, true to fill forward, false otherwise - defaults to true
--leverage DECIMAL The leverage for the security, defaults to 2 for equity, 50 for forex, and 1 for everything
else
--extended-market-hours The extended market hours flag, true to allow pre/post market data, false for only in market
data
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/add_security.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/add_security.py)_
### `lean live cancel-order`
Represents a command to cancel a specific order by id.
```
Usage: lean live cancel-order [OPTIONS] PROJECT
Represents a command to cancel a specific order by id.
Options:
--order-id INTEGER The order id to be cancelled [required]
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/cancel_order.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/cancel_order.py)_
### `lean live command`
Send a command to a local running live trading project.
```
Usage: lean live command [OPTIONS] PROJECT
Send a command to a local running live trading project.
Options:
--data TEXT The command to send, 'str' representation of a 'dict' e.g. "{ \"target\": \"BTCUSD\",
\"$type\":\"MyCommand\" }"
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/command.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/command.py)_
### `lean live deploy`
Start live trading a project locally using Docker.
```
Usage: lean live deploy [OPTIONS] PROJECT
Start live trading a project locally using Docker.
If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.
If PROJECT is a file, the algorithm in the specified file will be executed.
By default an interactive wizard is shown letting you configure the brokerage and live data provider to use. If
--environment, --brokerage or --data-provider-live are given the command runs in non-interactive mode. In this mode
the CLI does not prompt for input.
If --environment is given it must be the name of a live environment in the Lean configuration.
If --brokerage and --data-provider-live are given, the options specific to the given brokerage/live data provider must
also be given. The Lean config is used as fallback when a brokerage/live data provider-specific option hasn't been
passed in. If a required option is not given and cannot be found in the Lean config the command aborts.
By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you
can set the default engine image for all commands using `lean config set engine-image <image>`.
Options:
--environment TEXT The environment to use
--output DIRECTORY Directory to store results in (defaults to PROJECT/live/TIMESTAMP)
-d, --detach Run the live deployment in a detached Docker container and return immediately
--brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|Bybit|TradeStation|Alpaca]
The brokerage to use
--data-provider-live [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|IQFeed|Polygon|IEX|CoinApi|ThetaData|Custom data only|Bybit|TradeStation|Alpaca]
The live data provider to use
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
--ib-password TEXT Your Interactive Brokers password
--ib-weekly-restart-utc-time TEXT
Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at
this time, and will require 2FA verification. This is required by Interactive Brokers.
Use this option explicitly to override the default value. (Optional).
--tradier-account-id TEXT Your Tradier account id
--tradier-access-token TEXT Your Tradier access token
--tradier-environment [live|paper]
Whether the developer sandbox should be used
--oanda-account-id TEXT Your OANDA account id
--oanda-access-token TEXT Your OANDA API token
--oanda-environment [Practice|Trade]
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
--binanceus-api-key TEXT Your Binance API key
--binance-api-secret TEXT Your Binance API secret
--binanceus-api-secret TEXT Your Binance API secret
--binance-use-testnet [live|paper]
Whether the testnet should be used
--zerodha-api-key TEXT Your Kite Connect API key
--zerodha-access-token TEXT Your Kite Connect access token
--zerodha-product-type [mis|cnc|nrml]
MIS if you are targeting intraday products, CNC if you are targeting delivery
products, NRML if you are targeting carry forward products
--zerodha-trading-segment [equity|commodity]
EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading
commodities on MCX
--zerodha-history-subscription [true|false]
Whether you have a history API subscription for Zerodha
--samco-client-id TEXT Your Samco account Client ID
--samco-client-password TEXT Your Samco account password
--samco-year-of-birth TEXT Your year of birth (YYYY) registered with Samco
--samco-product-type [mis|cnc|nrml]
MIS if you are targeting intraday products, CNC if you are targeting delivery
products, NRML if you are targeting carry forward products
--samco-trading-segment [equity|commodity]
EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading
commodities on MCX
--terminal-link-connection-type [DAPI|SAPI]
Terminal Link Connection Type [DAPI, SAPI]
--terminal-link-environment [Production|Beta]
The environment to run in
--terminal-link-server-host TEXT
The host of the TerminalLink server
--terminal-link-server-port INTEGER
The port of the TerminalLink server
--terminal-link-emsx-broker TEXT
The EMSX broker to use (Optional).
--terminal-link-emsx-account TEXT
The EMSX account to use (Optional).
--terminal-link-emsx-team TEXT The EMSX team to receive order events from (Optional).
--terminal-link-openfigi-api-key TEXT
The Open FIGI API key to use for mapping options
--terminal-link-server-auth-id TEXT
The Auth ID of the TerminalLink server
--tt-user-name TEXT Your Trading Technologies username
--tt-session-password TEXT Your Trading Technologies session password
--tt-account-name TEXT Your Trading Technologies account name
--tt-rest-app-key TEXT Your Trading Technologies REST app key
--tt-rest-app-secret TEXT Your Trading Technologies REST app secret
--tt-rest-environment TEXT The REST environment to run in
--tt-order-routing-sender-comp-id TEXT
The order routing sender comp id to use
--tt-market-data-sender-comp-id TEXT
The market data sender comp id to use
--tt-market-data-target-comp-id TEXT
The market data target comp id to use
--tt-market-data-host TEXT The host of the market data server
--tt-market-data-port TEXT The port of the market data server
--tt-order-routing-target-comp-id TEXT
The order routing target comp id to use
--tt-order-routing-host TEXT The host of the order routing server
--tt-order-routing-port TEXT The port of the order routing server
--tt-log-fix-messages BOOLEAN Whether FIX messages should be logged (Optional).
--kraken-api-key TEXT Your Kraken API key
--kraken-api-secret TEXT Your Kraken API secret
--kraken-verification-tier [Starter|Intermediate|Pro]
Your Kraken Verification Tier
--tdameritrade-api-key TEXT Your TDAmeritrade API key
--tdameritrade-access-token TEXT
Your TDAmeritrade OAuth Access Token
--tdameritrade-account-number TEXT
Your TDAmeritrade account number
--bybit-api-key TEXT Your Bybit API key
--bybit-api-secret TEXT Your Bybit API secret
--bybit-vip-level [VIP0|VIP1|VIP2|VIP3|VIP4|VIP5|SupremeVIP|Pro1|Pro2|Pro3|Pro4|Pro5]
Your Bybit VIP Level
--bybit-use-testnet [live|paper]
Whether the testnet should be used
--trade-station-environment [live|paper]
Whether Live or Paper environment should be used
--trade-station-account-id TEXT
The TradeStation account Id
--alpaca-environment [live|paper]
Whether Live or Paper environment should be used
--ib-enable-delayed-streaming-data BOOLEAN
Whether delayed data may be used when your algorithm subscribes to a security you
don't have a market data subscription for (Optional).
--iqfeed-iqconnect TEXT The path to the IQConnect binary
--iqfeed-username TEXT Your IQFeed username
--iqfeed-password TEXT Your IQFeed password
--iqfeed-version TEXT The product version of your IQFeed developer account
--iqfeed-host TEXT The IQFeed host address (Optional).
--polygon-api-key TEXT Your Polygon.io API Key
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
--thetadata-ws-url TEXT The ThetaData host address (Optional).
--thetadata-rest-url TEXT The ThetaData host address (Optional).
--thetadata-subscription-plan [Free|Value|Standard|Pro]
Your ThetaData subscription price plan
--alpaca-api-key TEXT Your Alpaca Api Key
--alpaca-api-secret TEXT Your Alpaca Api Secret
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
--release Compile C# projects in release configuration instead of debug
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
--python-venv TEXT The path of the python virtual environment to be used
--live-cash-balance TEXT A comma-separated list of currency:amount pairs of initial cash balance
--live-holdings TEXT A comma-separated list of symbol:symbolId:quantity:averagePrice of initial portfolio
holdings
--update Pull the LEAN engine image before starting live trading
--show-secrets Show secrets as they are input
--extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-
py.readthedocs.io/en/stable/containers.html
--no-update Use the local LEAN engine image instead of pulling the latest version
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/deploy.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/deploy.py)_
### `lean live liquidate`
Liquidate the given symbol from the latest deployment of the given project.
```
Usage: lean live liquidate [OPTIONS] PROJECT
Liquidate the given symbol from the latest deployment of the given project.
Options:
--ticker TEXT The ticker of the symbol to liquidate
--market TEXT The market of the symbol to liquidate
--security-type TEXT The security type of the symbol to liquidate
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/liquidate.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/liquidate.py)_
### `lean live stop`
Stop an already running local live trading project.
```
Usage: lean live stop [OPTIONS] PROJECT
Stop an already running local live trading project.
Options:
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/stop.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/stop.py)_
### `lean live submit-order`
Represents a command to submit an order to the algorithm.
```
Usage: lean live submit-order [OPTIONS] PROJECT
Represents a command to submit an order to the algorithm.
Options:
--ticker TEXT The ticker of the symbol to be submitted [required]
--market TEXT The market of the symbol to be submitted [required]
--security-type TEXT The security type of the symbol to be submitted [required]
--order-type TEXT The order type to be submitted [required]
--quantity DECIMAL The number of units to be ordered (directional) [required]
--limit-price DECIMAL The limit price of the order be submitted
--stop-price DECIMAL The stop price of the order to be submitted
--tag TEXT The tag to be attached to the order
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/submit_order.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/submit_order.py)_
### `lean live update-order`
Represents a command to update a specific order by id.
```
Usage: lean live update-order [OPTIONS] PROJECT
Represents a command to update a specific order by id.
Options:
--order-id INTEGER The order id to be updated [required]
--quantity DECIMAL The number of units to be updated (directional)
--limit-price DECIMAL The limit price of the order to be updated
--stop-price DECIMAL The stop price of the order to be updated
--tag TEXT The tag to be attached to the order
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/live/update_order.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/update_order.py)_
### `lean login`
Log in with a QuantConnect account.
```
Usage: lean login [OPTIONS]
Log in with a QuantConnect account.
If user id or API token is not provided an interactive prompt will show.
Credentials are stored in ~/.lean/credentials and are removed upon running `lean logout`.
Options:
-u, --user-id TEXT QuantConnect user id
-t, --api-token TEXT QuantConnect API token
--show-secrets Show secrets as they are input
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/login.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/login.py)_
### `lean logout`
Log out and remove stored credentials.
```
Usage: lean logout [OPTIONS]
Log out and remove stored credentials.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/logout.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/logout.py)_
### `lean logs`
Display the most recent backtest/live/optimization logs.
```
Usage: lean logs [OPTIONS]
Display the most recent backtest/live/optimization logs.
Options:
--backtest Display the most recent backtest logs (default)
--live Display the most recent live logs
--optimization Display the most recent optimization logs
--project DIRECTORY The project to get the most recent logs from
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/logs.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/logs.py)_
### `lean object-store delete`
Opens the local storage directory in the file explorer.
```
Usage: lean object-store delete [OPTIONS]
Opens the local storage directory in the file explorer.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/object_store/delete.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/delete.py)_
### `lean object-store get`
Opens the local storage directory in the file explorer.
```
Usage: lean object-store get [OPTIONS]
Opens the local storage directory in the file explorer.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/object_store/get.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/get.py)_
### `lean object-store list`
Opens the local storage directory in the file explorer.
```
Usage: lean object-store list [OPTIONS]
Opens the local storage directory in the file explorer.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/object_store/list.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/list.py)_
### `lean object-store ls`
Alias for 'list'
```
Usage: lean object-store ls [OPTIONS]
Opens the local storage directory in the file explorer.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/object_store/ls.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/ls.py)_
### `lean object-store properties`
Opens the local storage directory in the file explorer.
```
Usage: lean object-store properties [OPTIONS]
Opens the local storage directory in the file explorer.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/object_store/properties.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/properties.py)_
### `lean object-store set`
Opens the local storage directory in the file explorer.
```
Usage: lean object-store set [OPTIONS]
Opens the local storage directory in the file explorer.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/object_store/set.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/set.py)_
### `lean optimize`
Optimize a project's parameters locally using Docker.
```
Usage: lean optimize [OPTIONS] PROJECT
Optimize a project's parameters locally using Docker.
If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.
If PROJECT is a file, the algorithm in the specified file will be executed.
By default an interactive wizard is shown letting you configure the optimizer. If --optimizer-config or --strategy is
given the command runs in non-interactive mode. In this mode the CLI does not prompt for input.
The --optimizer-config option can be used to specify the configuration to run the optimizer with.
When using the option it should point to a file like this (the algorithm-* properties should be omitted):
https://github.com/QuantConnect/Lean/blob/master/Optimizer.Launcher/config.json
If --strategy is given the optimizer configuration is read from the given options. In this case --strategy, --target,
--target-direction and --parameter become required.
In non-interactive mode the --parameter option can be provided multiple times to configure multiple parameters:
- --parameter <name> <min value> <max value> <step size>
- --parameter my-first-parameter 1 10 0.5 --parameter my-second-parameter 20 30 5
In non-interactive mode the --constraint option can be provided multiple times to configure multiple constraints:
- --constraint "<statistic> <operator> <value>"
- --constraint "Sharpe Ratio >= 0.5" --constraint "Drawdown < 0.25"
If --estimate is given, the optimization will not be executed.
The runtime estimate for the optimization will be calculated and outputted.
By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you
can set the default engine image for all commands using `lean config set engine-image <image>`.
Options:
--output DIRECTORY Directory to store results in (defaults to PROJECT/optimizations/TIMESTAMP)
-d, --detach Run the optimization in a detached Docker container and return immediately
--optimizer-config FILE The optimizer configuration file that should be used
--strategy [Grid Search|Euler Search]
The optimization strategy to use
--target TEXT The target statistic of the optimization
--target-direction [min|max] Whether the target must be minimized or maximized
--parameter <TEXT FLOAT FLOAT FLOAT>...
The 'parameter min max step' pairs configuring the parameters to optimize
--constraint TEXT The 'statistic operator value' pairs configuring the constraints of the optimization
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--download-data Update the Lean configuration file to download data from the QuantConnect API, alias
for --data-provider-historical QuantConnect
--data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the backtest when using
QuantConnect as historical data provider
--release Compile C# projects in release configuration instead of debug
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
--update Pull the LEAN engine image before running the optimizer
--estimate Estimate optimization runtime without running it
--max-concurrent-backtests INTEGER RANGE
Maximum number of concurrent backtests to run [x>=1]
--extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-
py.readthedocs.io/en/stable/containers.html
--no-update Use the local LEAN engine image instead of pulling the latest version
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
--ib-password TEXT Your Interactive Brokers password
--ib-weekly-restart-utc-time TEXT
Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at
this time, and will require 2FA verification. This is required by Interactive Brokers.
Use this option explicitly to override the default value. (Optional).
--oanda-account-id TEXT Your OANDA account id
--oanda-access-token TEXT Your OANDA API token
--oanda-environment [Practice|Trade]
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
--binanceus-api-key TEXT Your Binance API key
--binance-api-secret TEXT Your Binance API secret
--binanceus-api-secret TEXT Your Binance API secret
--kraken-api-key TEXT Your Kraken API key
--kraken-api-secret TEXT Your Kraken API secret
--kraken-verification-tier [Starter|Intermediate|Pro]
Your Kraken Verification Tier
--iqfeed-iqconnect TEXT The path to the IQConnect binary
--iqfeed-username TEXT Your IQFeed username
--iqfeed-password TEXT Your IQFeed password
--iqfeed-version TEXT The product version of your IQFeed developer account
--iqfeed-host TEXT The IQFeed host address (Optional).
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
--thetadata-ws-url TEXT The ThetaData host address (Optional).
--thetadata-rest-url TEXT The ThetaData host address (Optional).
--thetadata-subscription-plan [Free|Value|Standard|Pro]
Your ThetaData subscription price plan
--terminal-link-connection-type [DAPI|SAPI]
Terminal Link Connection Type [DAPI, SAPI]
--terminal-link-environment [Production|Beta]
The environment to run in
--terminal-link-server-host TEXT
The host of the TerminalLink server
--terminal-link-server-port INTEGER
The port of the TerminalLink server
--terminal-link-openfigi-api-key TEXT
The Open FIGI API key to use for mapping options
--terminal-link-server-auth-id TEXT
The Auth ID of the TerminalLink server
--bybit-api-key TEXT Your Bybit API key
--bybit-api-secret TEXT Your Bybit API secret
--trade-station-environment [live|paper]
Whether Live or Paper environment should be used
--trade-station-account-id TEXT
The TradeStation account Id
--alpaca-environment [live|paper]
Whether Live or Paper environment should be used
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/optimize.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/optimize.py)_
### `lean private-cloud add-compute`
Add private cloud compute
```
Usage: lean private-cloud add-compute [OPTIONS]
Add private cloud compute
Options:
--token TEXT The master server token
--master-domain, --master-ip TEXT
The master server domain
--master-port INTEGER The master server port
--slave-domain, --slave-ip TEXT
The slave server domain
--update Pull the latest image before starting
--no-update Do not update to the latest version
--compute TEXT Compute configuration to use
--extra-docker-config TEXT Extra docker configuration as a JSON string
--stop Stop any existing deployment
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/private_cloud/add_compute.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/private_cloud/add_compute.py)_
### `lean private-cloud start`
Start a new private cloud
```
Usage: lean private-cloud start [OPTIONS]
Start a new private cloud
Options:
--master Run in master mode
--slave Run in slave mode
--token TEXT The master server token
--master-domain, --master-ip TEXT
The master server domain
--master-port INTEGER The master server port
--slave-domain, --slave-ip TEXT
The slave server domain
--update Pull the latest image before starting
--no-update Do not update to the latest version
--compute TEXT Compute configuration to use
--extra-docker-config TEXT Extra docker configuration as a JSON string
--stop Stop any existing deployment
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/private_cloud/start.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/private_cloud/start.py)_
### `lean private-cloud stop`
Stops a running private cloud
```
Usage: lean private-cloud stop [OPTIONS]
Stops a running private cloud
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/private_cloud/stop.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/private_cloud/stop.py)_
### `lean project-create`
Create a new project containing starter code.
```
Usage: lean project-create [OPTIONS] NAME
Create a new project containing starter code.
If NAME is a path containing subdirectories those will be created automatically.
The default language can be set using `lean config set default-language python/csharp`.
Options:
-l, --language [python|csharp] The language of the project to create
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/project_create.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/project_create.py)_
### `lean project-delete`
Delete a project locally and in the cloud if it exists.
```
Usage: lean project-delete [OPTIONS] PROJECT
Delete a project locally and in the cloud if it exists.
The project is selected by name or cloud id.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/project_delete.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/project_delete.py)_
### `lean report`
Generate a report of a backtest.
```
Usage: lean report [OPTIONS]
Generate a report of a backtest.
This runs the LEAN Report Creator in Docker to generate a polished, professional-grade report of a backtest.
If --backtest-results is not given, a report is generated for the most recent local backtest.
The name, description, and version are optional and will be blank if not given.
If the given backtest data source file is stored in a project directory (or one of its subdirectories, like the
default <project>/backtests/<timestamp>), the default name is the name of the project directory and the default
description is the description stored in the project's config.json file.
By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you
can set the default engine image for all commands using `lean config set engine-image <image>`.
Options:
--backtest-results FILE Path to the JSON file containing the backtest results
--live-results FILE Path to the JSON file containing the live trading results
--report-destination FILE Path where the generated report is stored as HTML (defaults to ./report.html)
--css FILE Path where the CSS override file is stored
--html FILE Path where the custom HTML template file is stored
-d, --detach Run the report creator in a detached Docker container and return immediately
--strategy-name TEXT Name of the strategy, will appear at the top-right corner of each page
--strategy-version TEXT Version number of the strategy, will appear next to the project name
--strategy-description TEXT Description of the strategy, will appear under the 'Strategy Description' section
--overwrite Overwrite --report-destination if it already contains a file
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
--update Pull the LEAN engine image before running the report creator
--pdf Create a PDF version along with the HTML version of the report
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/report.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/report.py)_
### `lean research`
Run a Jupyter Lab environment locally using Docker.
```
Usage: lean research [OPTIONS] PROJECT
Run a Jupyter Lab environment locally using Docker.
By default the official LEAN research image is used. You can override this using the --image option. Alternatively you
can set the default research image using `lean config set research-image <image>`.
Options:
--port INTEGER The port to run Jupyter Lab on (defaults to 8888)
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
--ib-password TEXT Your Interactive Brokers password
--ib-weekly-restart-utc-time TEXT
Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at
this time, and will require 2FA verification. This is required by Interactive Brokers.
Use this option explicitly to override the default value. (Optional).
--oanda-account-id TEXT Your OANDA account id
--oanda-access-token TEXT Your OANDA API token
--oanda-environment [Practice|Trade]
The environment to run in, Practice for fxTrade Practice, Trade for fxTrade
--bitfinex-api-key TEXT Your Bitfinex API key
--bitfinex-api-secret TEXT Your Bitfinex API secret
--coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.
--coinbase-api-private-key TEXT
Your Coinbase Advanced Trade API private key from file.
--binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]
Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]
--binance-api-key TEXT Your Binance API key
--binanceus-api-key TEXT Your Binance API key
--binance-api-secret TEXT Your Binance API secret
--binanceus-api-secret TEXT Your Binance API secret
--kraken-api-key TEXT Your Kraken API key
--kraken-api-secret TEXT Your Kraken API secret
--kraken-verification-tier [Starter|Intermediate|Pro]
Your Kraken Verification Tier
--iqfeed-iqconnect TEXT The path to the IQConnect binary
--iqfeed-username TEXT Your IQFeed username
--iqfeed-password TEXT Your IQFeed password
--iqfeed-version TEXT The product version of your IQFeed developer account
--iqfeed-host TEXT The IQFeed host address (Optional).
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
--thetadata-ws-url TEXT The ThetaData host address (Optional).
--thetadata-rest-url TEXT The ThetaData host address (Optional).
--thetadata-subscription-plan [Free|Value|Standard|Pro]
Your ThetaData subscription price plan
--terminal-link-connection-type [DAPI|SAPI]
Terminal Link Connection Type [DAPI, SAPI]
--terminal-link-environment [Production|Beta]
The environment to run in
--terminal-link-server-host TEXT
The host of the TerminalLink server
--terminal-link-server-port INTEGER
The port of the TerminalLink server
--terminal-link-openfigi-api-key TEXT
The Open FIGI API key to use for mapping options
--terminal-link-server-auth-id TEXT
The Auth ID of the TerminalLink server
--bybit-api-key TEXT Your Bybit API key
--bybit-api-secret TEXT Your Bybit API secret
--trade-station-environment [live|paper]
Whether Live or Paper environment should be used
--trade-station-account-id TEXT
The TradeStation account Id
--alpaca-environment [live|paper]
Whether Live or Paper environment should be used
--download-data Update the Lean configuration file to download data from the QuantConnect API, alias
for --data-provider-historical QuantConnect
--data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the research session
when using QuantConnect as historical data provider
-d, --detach Run Jupyter Lab in a detached Docker container and return immediately
--no-open Don't open the Jupyter Lab environment in the browser after starting it
--image TEXT The LEAN research image to use (defaults to quantconnect/research:latest)
--update Pull the LEAN research image before starting the research environment
--extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-
py.readthedocs.io/en/stable/containers.html
--no-update Use the local LEAN research image instead of pulling the latest version
--lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/research.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/research.py)_
### `lean whoami`
Display who is logged in.
```
Usage: lean whoami [OPTIONS]
Display who is logged in.
Options:
--verbose Enable debug logging
--help Show this message and exit.
```
_See code: [lean/commands/whoami.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/whoami.py)_
<!-- commands end -->
## Development
To work on the Lean CLI, clone the repository, enter an environment containing Python 3.7+ and run `pip install -r requirements.txt`. This command will install the required dependencies and installs the CLI in editable mode. This means you'll be able to edit the code and immediately see the results the next time you run `lean`.
If you need to add dependencies, first update `setup.py` (if it is a production dependency) or `requirements.txt` (if it is a development dependency) and then re-run `pip install -r requirements.txt`.
The automated tests can be ran by running `pytest`. The filesystem and HTTP requests are mocked when running tests to make sure they run in an isolated environment.
Can build the lean CLI by running `python setup.py sdist bdist_wheel` from the root of the project and to install it `pip install --force-reinstall dist/lean-dev-py3-none-any.whl`. To update the commands reference part of the readme run `python scripts/readme.py` from the root of the project, after installing the new version.
Maintainers can publish new releases by pushing a Git tag containing the new version to GitHub. This will trigger a GitHub Actions workflow which releases the current `master` branch to PyPI with the value of the tag as version. Make sure the version is not prefixed with "v".
Raw data
{
"_id": null,
"home_page": "https://lean.io/cli",
"name": "lean",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "QuantConnect",
"author_email": "support@quantconnect.com",
"download_url": "https://files.pythonhosted.org/packages/90/ba/bc8624c04da8cc1429dcd6f2b0fe430fab6a798f5e2ecb66f088f647e65c/lean-1.0.211.tar.gz",
"platform": null,
"description": "![Lean CLI](http://cdn.quantconnect.com.s3.us-east-1.amazonaws.com/i/github/lean-cli-splash.png)\n\n# QuantConnect Lean CLI\n\n[![Build Status](https://github.com/QuantConnect/lean-cli/workflows/Build/badge.svg)](https://github.com/QuantConnect/lean-cli/actions?query=workflow%3ABuild)\n[![PyPI Version](https://img.shields.io/pypi/v/lean)](https://pypi.org/project/lean/)\n[![Project Status](https://img.shields.io/pypi/status/lean)](https://pypi.org/project/lean/)\n\nThe Lean CLI is a cross-platform CLI aimed at making it easier to develop with the LEAN engine locally and in the cloud.\n\nVisit the [documentation website](https://www.lean.io/docs/v2/lean-cli/key-concepts/getting-started) for comprehensive and up-to-date documentation.\n\n## Highlights\n\n- [Project scaffolding](https://www.lean.io/docs/v2/lean-cli/projects/project-management)\n- [Local autocomplete](https://www.lean.io/docs/v2/lean-cli/projects/autocomplete)\n- [Local data downloading](https://www.lean.io/docs/v2/lean-cli/datasets/downloading-quantconnect-data)\n- [Local backtesting](https://www.lean.io/docs/v2/lean-cli/backtesting/deployment#02-Run-Local-Backtests)\n- [Local debugging](https://www.lean.io/docs/v2/lean-cli/backtesting/debugging)\n- [Local research environment](https://www.lean.io/docs/v2/lean-cli/research)\n- [Local optimization](https://www.lean.io/docs/v2/lean-cli/optimization/deployment#02-Run-Local-Optimizations)\n- [Local live trading](https://www.lean.io/docs/v2/lean-cli/live-trading/quantconnect-paper-trading#02-Deploy-Local-Algorithms)\n- [Local backtest report creation](https://www.lean.io/docs/v2/lean-cli/backtesting/report#02-Generate-a-Report)\n- [Cloud synchronization](https://www.lean.io/docs/v2/lean-cli/projects/cloud-synchronization)\n- [Cloud backtesting](https://www.lean.io/docs/v2/lean-cli/backtesting/deployment#03-Run-Cloud-Backtests)\n- [Cloud optimization](https://www.lean.io/docs/v2/lean-cli/optimization/deployment#03-Run-Cloud-Optimizations)\n- [Cloud live trading](https://www.lean.io/docs/v2/lean-cli/live-trading/quantconnect-paper-trading#03-Deploy-Cloud-Algorithms)\n\n## Installation\n\nThe CLI can be installed and updated by running `pip install --upgrade lean`.\n\nNote that many commands in the CLI require Docker to run. See [Get Docker](https://docs.docker.com/get-docker/) for instructions on how to install Docker for your operating system.\n\n**Note:** Some Linux users may need to install `tkinter` using the following commands:\n\n``` \nFor Python 3\n\nsudo apt-get install python3-tk\n\nFor Python 2.7\n\nsudo apt-get install python-tk\n```\nAfter installing the CLI, open a terminal in an empty directory and run `lean init`. This command downloads the latest configuration file and sample data from the [QuantConnect/Lean](https://github.com/QuantConnect/Lean) repository. We recommend running all Lean CLI commands in the same directory `lean init` was ran in.\n\n## Usage\n\nThe Lean CLI supports multiple workflows. The examples below serve as a starting point, you're free to mix local and cloud features in any way you'd like.\n\nA cloud-focused workflow (local development, cloud execution) with the CLI may look like this:\n1. Open a terminal in the directory you ran `lean init` in.\n2. Run `lean cloud pull` to pull remotely changed files.\n3. Start programming locally and run backtests in the cloud with `lean cloud backtest \"Project Name\" --open --push` whenever there is something to backtest. The `--open` flag means that the backtest results will be opened in the browser when done, while the `--push` flag means that local changes are pushed to the cloud before running the backtest.\n4. Whenever you want to create a new project, run `lean create-project \"Project Name\"` and `lean cloud push --project \"Project Name\"` to create a new project containing some basic code and to push it to the cloud.\n5. When you're finished for the moment, run `lean cloud push` to push all locally changed files to the cloud.\n\nA locally-focused workflow (local development, local execution) with the CLI may look like this:\n1. Open a terminal in the directory you ran `lean init` in.\n2. Run `lean create-project \"Project Name\"` to create a new project with some basic code to get you started.\n3. Work on your strategy in `./Project Name`.\n4. Run `lean research \"Project Name\"` to start a Jupyter Lab session to perform research in.\n5. Run `lean backtest \"Project Name\"` to run a backtest whenever there's something to test. This runs your strategy in a Docker container containing the same packages as the ones used on QuantConnect.com, but with your own data.\n\n## Commands\n\n*Note: the readme only contains the `--help` text of all commands. Visit the [documentation website](https://www.lean.io/docs/v2/lean-cli/key-concepts/getting-started) for more comprehensive documentation.*\n\n<!-- commands start -->\n- [`lean backtest`](#lean-backtest)\n- [`lean build`](#lean-build)\n- [`lean cloud backtest`](#lean-cloud-backtest)\n- [`lean cloud live`](#lean-cloud-live)\n- [`lean cloud live command`](#lean-cloud-live-command)\n- [`lean cloud live deploy`](#lean-cloud-live-deploy)\n- [`lean cloud live liquidate`](#lean-cloud-live-liquidate)\n- [`lean cloud live stop`](#lean-cloud-live-stop)\n- [`lean cloud object-store delete`](#lean-cloud-object-store-delete)\n- [`lean cloud object-store get`](#lean-cloud-object-store-get)\n- [`lean cloud object-store list`](#lean-cloud-object-store-list)\n- [`lean cloud object-store ls`](#lean-cloud-object-store-ls)\n- [`lean cloud object-store properties`](#lean-cloud-object-store-properties)\n- [`lean cloud object-store set`](#lean-cloud-object-store-set)\n- [`lean cloud optimize`](#lean-cloud-optimize)\n- [`lean cloud pull`](#lean-cloud-pull)\n- [`lean cloud push`](#lean-cloud-push)\n- [`lean cloud status`](#lean-cloud-status)\n- [`lean config get`](#lean-config-get)\n- [`lean config list`](#lean-config-list)\n- [`lean config set`](#lean-config-set)\n- [`lean config unset`](#lean-config-unset)\n- [`lean create-project`](#lean-create-project)\n- [`lean data download`](#lean-data-download)\n- [`lean data generate`](#lean-data-generate)\n- [`lean decrypt`](#lean-decrypt)\n- [`lean delete-project`](#lean-delete-project)\n- [`lean encrypt`](#lean-encrypt)\n- [`lean init`](#lean-init)\n- [`lean library add`](#lean-library-add)\n- [`lean library remove`](#lean-library-remove)\n- [`lean live`](#lean-live)\n- [`lean live add-security`](#lean-live-add-security)\n- [`lean live cancel-order`](#lean-live-cancel-order)\n- [`lean live command`](#lean-live-command)\n- [`lean live deploy`](#lean-live-deploy)\n- [`lean live liquidate`](#lean-live-liquidate)\n- [`lean live stop`](#lean-live-stop)\n- [`lean live submit-order`](#lean-live-submit-order)\n- [`lean live update-order`](#lean-live-update-order)\n- [`lean login`](#lean-login)\n- [`lean logout`](#lean-logout)\n- [`lean logs`](#lean-logs)\n- [`lean object-store delete`](#lean-object-store-delete)\n- [`lean object-store get`](#lean-object-store-get)\n- [`lean object-store list`](#lean-object-store-list)\n- [`lean object-store ls`](#lean-object-store-ls)\n- [`lean object-store properties`](#lean-object-store-properties)\n- [`lean object-store set`](#lean-object-store-set)\n- [`lean optimize`](#lean-optimize)\n- [`lean private-cloud add-compute`](#lean-private-cloud-add-compute)\n- [`lean private-cloud start`](#lean-private-cloud-start)\n- [`lean private-cloud stop`](#lean-private-cloud-stop)\n- [`lean project-create`](#lean-project-create)\n- [`lean project-delete`](#lean-project-delete)\n- [`lean report`](#lean-report)\n- [`lean research`](#lean-research)\n- [`lean whoami`](#lean-whoami)\n\n### `lean backtest`\n\nBacktest a project locally using Docker.\n\n```\nUsage: lean backtest [OPTIONS] PROJECT\n\n Backtest a project locally using Docker.\n\n If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.\n If PROJECT is a file, the algorithm in the specified file will be executed.\n\n Go to the following url to learn how to debug backtests locally using the Lean CLI:\n https://www.lean.io/docs/v2/lean-cli/backtesting/debugging\n\n By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you\n can set the default engine image for all commands using `lean config set engine-image <image>`.\n\nOptions:\n --output DIRECTORY Directory to store results in (defaults to PROJECT/backtests/TIMESTAMP)\n -d, --detach Run the backtest in a detached Docker container and return immediately\n --debug [pycharm|ptvsd|debugpy|vsdbg|rider|local-platform]\n Enable a certain debugging method (see --help for more information)\n --data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]\n Update the Lean configuration file to retrieve data from the given historical provider\n --ib-user-name TEXT Your Interactive Brokers username\n --ib-account TEXT Your Interactive Brokers account id\n --ib-password TEXT Your Interactive Brokers password\n --ib-weekly-restart-utc-time TEXT\n Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at\n this time, and will require 2FA verification. This is required by Interactive Brokers.\n Use this option explicitly to override the default value. (Optional).\n --oanda-account-id TEXT Your OANDA account id\n --oanda-access-token TEXT Your OANDA API token\n --oanda-environment [Practice|Trade]\n The environment to run in, Practice for fxTrade Practice, Trade for fxTrade\n --bitfinex-api-key TEXT Your Bitfinex API key\n --bitfinex-api-secret TEXT Your Bitfinex API secret\n --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.\n --coinbase-api-private-key TEXT\n Your Coinbase Advanced Trade API private key from file.\n --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]\n Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]\n --binance-api-key TEXT Your Binance API key\n --binanceus-api-key TEXT Your Binance API key\n --binance-api-secret TEXT Your Binance API secret\n --binanceus-api-secret TEXT Your Binance API secret\n --kraken-api-key TEXT Your Kraken API key\n --kraken-api-secret TEXT Your Kraken API secret\n --kraken-verification-tier [Starter|Intermediate|Pro]\n Your Kraken Verification Tier\n --iqfeed-iqconnect TEXT The path to the IQConnect binary\n --iqfeed-username TEXT Your IQFeed username\n --iqfeed-password TEXT Your IQFeed password\n --iqfeed-version TEXT The product version of your IQFeed developer account\n --iqfeed-host TEXT The IQFeed host address (Optional).\n --polygon-api-key TEXT Your Polygon.io API Key\n --factset-auth-config-file FILE\n The path to the FactSet authentication configuration file\n --iex-cloud-api-key TEXT Your iexcloud.io API token publishable key\n --iex-price-plan [Launch|Grow|Enterprise]\n Your IEX Cloud Price plan\n --alpha-vantage-api-key TEXT Your Alpha Vantage Api Key\n --alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]\n Your Alpha Vantage Premium API Key plan\n --coinapi-api-key TEXT Your coinapi.io Api Key\n --coinapi-product [Free|Startup|Streamer|Professional|Enterprise]\n CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)\n --thetadata-ws-url TEXT The ThetaData host address (Optional).\n --thetadata-rest-url TEXT The ThetaData host address (Optional).\n --thetadata-subscription-plan [Free|Value|Standard|Pro]\n Your ThetaData subscription price plan\n --terminal-link-connection-type [DAPI|SAPI]\n Terminal Link Connection Type [DAPI, SAPI]\n --terminal-link-environment [Production|Beta]\n The environment to run in\n --terminal-link-server-host TEXT\n The host of the TerminalLink server\n --terminal-link-server-port INTEGER\n The port of the TerminalLink server\n --terminal-link-openfigi-api-key TEXT\n The Open FIGI API key to use for mapping options\n --terminal-link-server-auth-id TEXT\n The Auth ID of the TerminalLink server\n --bybit-api-key TEXT Your Bybit API key\n --bybit-api-secret TEXT Your Bybit API secret\n --trade-station-environment [live|paper]\n Whether Live or Paper environment should be used\n --trade-station-account-id TEXT\n The TradeStation account Id\n --alpaca-environment [live|paper]\n Whether Live or Paper environment should be used\n --download-data Update the Lean configuration file to download data from the QuantConnect API, alias\n for --data-provider-historical QuantConnect\n --data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the backtest when using\n QuantConnect as historical data provider\n --release Compile C# projects in release configuration instead of debug\n --image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)\n --python-venv TEXT The path of the python virtual environment to be used\n --update Pull the LEAN engine image before running the backtest\n --backtest-name TEXT Backtest name\n --extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-\n py.readthedocs.io/en/stable/containers.html\n --no-update Use the local LEAN engine image instead of pulling the latest version\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/backtest.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/backtest.py)_\n\n### `lean build`\n\nBuild Docker images of your own version of LEAN.\n\n```\nUsage: lean build [OPTIONS] [ROOT]\n\n Build Docker images of your own version of LEAN.\n\n ROOT must point to a directory containing the LEAN repository:\n https://github.com/QuantConnect/Lean\n\n When ROOT is not given, the current directory is used as root directory.\n\n This command performs the following actions:\n 1. The lean-cli/foundation:latest image is built from Lean/DockerfileLeanFoundation(ARM).\n 2. LEAN is compiled in a Docker container using the lean-cli/foundation:latest image.\n 3. The lean-cli/engine:latest image is built from Lean/Dockerfile using lean-cli/foundation:latest as base image.\n 4. The lean-cli/research:latest image is built from Lean/DockerfileJupyter using lean-cli/engine:latest as base image.\n 5. The default engine image is set to lean-cli/engine:latest.\n 6. The default research image is set to lean-cli/research:latest.\n\n When the foundation Dockerfile is the same as the official foundation Dockerfile, quantconnect/lean:foundation is used\n instead of building a custom foundation image.\n\nOptions:\n --tag TEXT The tag to apply to custom images (defaults to latest)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/build.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/build.py)_\n\n### `lean cloud backtest`\n\nBacktest a project in the cloud.\n\n```\nUsage: lean cloud backtest [OPTIONS] PROJECT\n\n Backtest a project in the cloud.\n\n PROJECT must be the name or id of the project to run a backtest for.\n\n If the project that has to be backtested has been pulled to the local drive with `lean cloud pull` it is possible to\n use the --push option to push local modifications to the cloud before running the backtest.\n\nOptions:\n --name TEXT The name of the backtest (a random one is generated if not specified)\n --push Push local modifications to the cloud before running the backtest\n --open Automatically open the results in the browser when the backtest is finished\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/backtest.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/backtest.py)_\n\n### `lean cloud live`\n\nInteract with the QuantConnect cloud live deployments.\n\n```\nUsage: lean cloud live [OPTIONS] COMMAND [ARGS]...\n\n Interact with the QuantConnect cloud live deployments.\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n command Send a command to a running cloud live trading project.\n deploy Start live trading for a project in the cloud.\n liquidate Stops live trading and liquidates existing positions for a certain project.\n stop Stops live trading for a certain project without liquidating existing positions.\n```\n\n### `lean cloud live command`\n\nSend a command to a running cloud live trading project.\n\n```\nUsage: lean cloud live command [OPTIONS] PROJECT\n\n Send a command to a running cloud live trading project.\n\nOptions:\n --data TEXT The command to send, 'str' representation of a 'dict' e.g. \"{ \\\"target\\\": \\\"BTCUSD\\\",\n \\\"$type\\\":\\\"MyCommand\\\" }\"\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/live/command.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/command.py)_\n\n### `lean cloud live deploy`\n\nStart live trading for a project in the cloud.\n\n```\nUsage: lean cloud live deploy [OPTIONS] PROJECT\n\n Start live trading for a project in the cloud.\n\n PROJECT must be the name or the id of the project to start live trading for.\n\n By default an interactive wizard is shown letting you configure the deployment. If --brokerage is given the command\n runs in non-interactive mode. In this mode the CLI does not prompt for input or confirmation. In non-interactive mode\n the options specific to the given brokerage are required, as well as --node, --auto-restart, --notify-order-events and\n --notify-insights.\n\nOptions:\n --brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|Bybit|TradeStation|Alpaca]\n The brokerage to use\n --data-provider-live [QuantConnect|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|Polygon|IEX|CoinApi|Bybit|TradeStation|Alpaca]\n The live data provider to use\n --ib-user-name TEXT Your Interactive Brokers username\n --ib-account TEXT Your Interactive Brokers account id\n --ib-password TEXT Your Interactive Brokers password\n --ib-weekly-restart-utc-time TEXT\n Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at\n this time, and will require 2FA verification. This is required by Interactive Brokers.\n Use this option explicitly to override the default value. (Optional).\n --tradier-account-id TEXT Your Tradier account id\n --tradier-access-token TEXT Your Tradier access token\n --tradier-environment [live|paper]\n Whether the developer sandbox should be used\n --oanda-account-id TEXT Your OANDA account id\n --oanda-access-token TEXT Your OANDA API token\n --oanda-environment [Practice|Trade]\n The environment to run in, Practice for fxTrade Practice, Trade for fxTrade\n --bitfinex-api-key TEXT Your Bitfinex API key\n --bitfinex-api-secret TEXT Your Bitfinex API secret\n --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.\n --coinbase-api-private-key TEXT\n Your Coinbase Advanced Trade API private key from file.\n --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]\n Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]\n --binance-api-key TEXT Your Binance API key\n --binanceus-api-key TEXT Your Binance API key\n --binance-api-secret TEXT Your Binance API secret\n --binanceus-api-secret TEXT Your Binance API secret\n --binance-use-testnet [live|paper]\n Whether the testnet should be used\n --zerodha-api-key TEXT Your Kite Connect API key\n --zerodha-access-token TEXT Your Kite Connect access token\n --zerodha-product-type [mis|cnc|nrml]\n MIS if you are targeting intraday products, CNC if you are targeting delivery\n products, NRML if you are targeting carry forward products\n --zerodha-trading-segment [equity|commodity]\n EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading\n commodities on MCX\n --zerodha-history-subscription [true|false]\n Whether you have a history API subscription for Zerodha\n --samco-client-id TEXT Your Samco account Client ID\n --samco-client-password TEXT Your Samco account password\n --samco-year-of-birth TEXT Your year of birth (YYYY) registered with Samco\n --samco-product-type [mis|cnc|nrml]\n MIS if you are targeting intraday products, CNC if you are targeting delivery\n products, NRML if you are targeting carry forward products\n --samco-trading-segment [equity|commodity]\n EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading\n commodities on MCX\n --terminal-link-server-auth-id TEXT\n The Auth ID of the TerminalLink server\n --terminal-link-environment [Production|Beta]\n The environment to run in\n --terminal-link-server-host TEXT\n The host of the SAPI server\n --terminal-link-server-port INTEGER\n The port of the SAPI server\n --terminal-link-emsx-broker TEXT\n The EMSX broker to use (Optional).\n --terminal-link-emsx-account TEXT\n The EMSX account to use (Optional).\n --terminal-link-emsx-team TEXT The EMSX team to receive order events from (Optional).\n --terminal-link-openfigi-api-key TEXT\n The Open FIGI API key to use for mapping options\n --tt-user-name TEXT Your Trading Technologies username\n --tt-session-password TEXT Your Trading Technologies session password\n --tt-account-name TEXT Your Trading Technologies account name\n --tt-rest-app-key TEXT Your Trading Technologies REST app key\n --tt-rest-app-secret TEXT Your Trading Technologies REST app secret\n --tt-rest-environment TEXT The REST environment to run in\n --tt-order-routing-sender-comp-id TEXT\n The order routing sender comp id to use\n --kraken-api-key TEXT Your Kraken API key\n --kraken-api-secret TEXT Your Kraken API secret\n --kraken-verification-tier [Starter|Intermediate|Pro]\n Your Kraken Verification Tier\n --tdameritrade-api-key TEXT Your TDAmeritrade API key\n --tdameritrade-access-token TEXT\n Your TDAmeritrade OAuth Access Token\n --tdameritrade-account-number TEXT\n Your TDAmeritrade account number\n --bybit-api-key TEXT Your Bybit API key\n --bybit-api-secret TEXT Your Bybit API secret\n --bybit-vip-level [VIP0|VIP1|VIP2|VIP3|VIP4|VIP5|SupremeVIP|Pro1|Pro2|Pro3|Pro4|Pro5]\n Your Bybit VIP Level\n --trade-station-environment [live|paper]\n Whether Live or Paper environment should be used\n --trade-station-account-id TEXT\n The TradeStation account Id\n --alpaca-environment [live|paper]\n Whether Live or Paper environment should be used\n --polygon-api-key TEXT Your Polygon.io API Key\n --iex-cloud-api-key TEXT Your iexcloud.io API token publishable key\n --iex-price-plan [Launch|Grow|Enterprise]\n Your IEX Cloud Price plan\n --coinapi-api-key TEXT Your coinapi.io Api Key\n --coinapi-product [Free|Startup|Streamer|Professional|Enterprise]\n CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)\n --alpaca-api-key TEXT Your Alpaca Api Key\n --alpaca-api-secret TEXT Your Alpaca Api Secret\n --node TEXT The name or id of the live node to run on\n --auto-restart BOOLEAN Whether automatic algorithm restarting must be enabled\n --notify-order-events BOOLEAN Whether notifications must be sent for order events\n --notify-insights BOOLEAN Whether notifications must be sent for emitted insights\n --notify-emails TEXT A comma-separated list of 'email:subject' pairs configuring email-notifications\n --notify-webhooks TEXT A comma-separated list of 'url:HEADER_1=VALUE_1:HEADER_2=VALUE_2:etc' pairs\n configuring webhook-notifications\n --notify-sms TEXT A comma-separated list of phone numbers configuring SMS-notifications\n --notify-telegram TEXT A comma-separated list of 'user/group Id:token(optional)' pairs configuring telegram-\n notifications\n --live-cash-balance TEXT A comma-separated list of currency:amount pairs of initial cash balance\n --live-holdings TEXT A comma-separated list of symbol:symbolId:quantity:averagePrice of initial portfolio\n holdings\n --push Push local modifications to the cloud before starting live trading\n --open Automatically open the live results in the browser once the deployment starts\n --show-secrets Show secrets as they are input\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/live/deploy.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/deploy.py)_\n\n### `lean cloud live liquidate`\n\nStops live trading and liquidates existing positions for a certain project.\n\n```\nUsage: lean cloud live liquidate [OPTIONS] PROJECT\n\n Stops live trading and liquidates existing positions for a certain project.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/live/liquidate.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/liquidate.py)_\n\n### `lean cloud live stop`\n\nStops live trading for a certain project without liquidating existing positions.\n\n```\nUsage: lean cloud live stop [OPTIONS] PROJECT\n\n Stops live trading for a certain project without liquidating existing positions.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/live/stop.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/live/stop.py)_\n\n### `lean cloud object-store delete`\n\nDelete a value from the organization's cloud object store.\n\n```\nUsage: lean cloud object-store delete [OPTIONS] KEY\n\n Delete a value from the organization's cloud object store.\n\n :param key: The desired key name to delete.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/object_store/delete.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/delete.py)_\n\n### `lean cloud object-store get`\n\nDownload an object store value to disk from the organization's cloud object store.\n\n```\nUsage: lean cloud object-store get [OPTIONS] [KEY]...\n\n Download an object store value to disk from the organization's cloud object store.\n\n :param key: The desired key to fetch, multiple can be provided.\n\nOptions:\n --destination-folder TEXT The destination folder to download the object store values, if not provided will use to\n current directory\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/object_store/get.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/get.py)_\n\n### `lean cloud object-store list`\n\nList all values for the given root key in the organization's cloud object store.\n\n```\nUsage: lean cloud object-store list [OPTIONS] [KEY]\n\n List all values for the given root key in the organization's cloud object store.\n\n :param key: The desired root key to list.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/object_store/list.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/list.py)_\n\n### `lean cloud object-store ls`\n\nAlias for 'list'\n\n```\nUsage: lean cloud object-store ls [OPTIONS] [KEY]\n\n List all values for the given root key in the organization's cloud object store.\n\n :param key: The desired root key to list.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/object_store/ls.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/ls.py)_\n\n### `lean cloud object-store properties`\n\nGet a value properties from the organization's cloud object store.\n\n```\nUsage: lean cloud object-store properties [OPTIONS] KEY\n\n Get a value properties from the organization's cloud object store.\n\n :param key: The desired key to fetch the properties for.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/object_store/properties.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/properties.py)_\n\n### `lean cloud object-store set`\n\nSets the data to the given key in the organization's cloud object store.\n\n```\nUsage: lean cloud object-store set [OPTIONS] KEY PATH\n\n Sets the data to the given key in the organization's cloud object store.\n\n :param key: The key to set the data to. :param path: Path to the file containing the object data.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/object_store/set.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/object_store/set.py)_\n\n### `lean cloud optimize`\n\nOptimize a project in the cloud.\n\n```\nUsage: lean cloud optimize [OPTIONS] PROJECT\n\n Optimize a project in the cloud.\n\n PROJECT must be the name or id of the project to optimize.\n\n An interactive prompt will be shown to configure the optimizer. If --target is given the command runs in non-\n interactive mode. In this mode the CLI does not prompt for input and the following options become required: --target,\n --target-direction, --parameter, --node and --parallel-nodes.\n\n In non-interactive mode the --parameter option can be provided multiple times to configure multiple parameters:\n - --parameter <name> <min value> <max value> <step size>\n - --parameter my-first-parameter 1 10 0.5 --parameter my-second-parameter 20 30 5\n\n In non-interactive mode the --constraint option can be provided multiple times to configure multiple constraints:\n - --constraint \"<statistic> <operator> <value>\"\n - --constraint \"Sharpe Ratio >= 0.5\" --constraint \"Drawdown < 0.25\"\n\n If the project that has to be optimized has been pulled to the local drive with `lean cloud pull` it is possible to\n use the --push option to push local modifications to the cloud before running the optimization.\n\nOptions:\n --target TEXT The target statistic of the optimization\n --target-direction [min|max] Whether the target must be minimized or maximized\n --parameter <TEXT FLOAT FLOAT FLOAT>...\n The 'parameter min max step' pairs configuring the parameters to optimize\n --constraint TEXT The 'statistic operator value' pairs configuring the constraints of the optimization\n --node [O2-8|O4-12|O8-16] The node type to run the optimization on\n --parallel-nodes INTEGER The number of nodes that may be run in parallel\n --name TEXT The name of the optimization (a random one is generated if not specified)\n --push Push local modifications to the cloud before starting the optimization\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/optimize.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/optimize.py)_\n\n### `lean cloud pull`\n\nPull projects from QuantConnect to the local drive.\n\n```\nUsage: lean cloud pull [OPTIONS]\n\n Pull projects from QuantConnect to the local drive.\n\n This command overrides the content of local files with the content of their respective counterparts in the cloud.\n\n This command will not delete local files for which there is no counterpart in the cloud.\n\nOptions:\n --project TEXT Name or id of the project to pull (all cloud projects if not specified)\n --pull-bootcamp Pull Boot Camp projects (disabled by default)\n --encrypt Pull your cloud files and encrypt them before saving on your local drive\n --decrypt Pull your cloud files and decrypt them before saving on your local drive\n --key FILE Path to the encryption key to use\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/pull.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/pull.py)_\n\n### `lean cloud push`\n\nPush local projects to QuantConnect.\n\n```\nUsage: lean cloud push [OPTIONS]\n\n Push local projects to QuantConnect.\n\n This command overrides the content of cloud files with the content of their respective local counterparts.\n\n This command will delete cloud files which don't have a local counterpart.\n\nOptions:\n --project DIRECTORY Path to the local project to push (all local projects if not specified)\n --encrypt Push your local files and encrypt them before saving on the cloud\n --decrypt Push your local files and decrypt them before saving on the cloud\n --key FILE Path to the encryption key to use\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/push.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/push.py)_\n\n### `lean cloud status`\n\nShow the live trading status of a project in the cloud.\n\n```\nUsage: lean cloud status [OPTIONS] PROJECT\n\n Show the live trading status of a project in the cloud.\n\n PROJECT must be the name or the id of the project to show the status for.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/cloud/status.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/cloud/status.py)_\n\n### `lean config get`\n\nGet the current value of a configurable option.\n\n```\nUsage: lean config get [OPTIONS] KEY\n\n Get the current value of a configurable option.\n\n Sensitive options like credentials cannot be retrieved this way for security reasons. Please open ~/.lean/credentials\n if you want to see your currently stored credentials.\n\n Run `lean config list` to show all available options.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/config/get.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/get.py)_\n\n### `lean config list`\n\nList the configurable options and their current values.\n\n```\nUsage: lean config list [OPTIONS]\n\n List the configurable options and their current values.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/config/list.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/list.py)_\n\n### `lean config set`\n\nSet a configurable option.\n\n```\nUsage: lean config set [OPTIONS] KEY VALUE\n\n Set a configurable option.\n\n Run `lean config list` to show all available options.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/config/set.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/set.py)_\n\n### `lean config unset`\n\nUnset a configurable option.\n\n```\nUsage: lean config unset [OPTIONS] KEY\n\n Unset a configurable option.\n\n Run `lean config list` to show all available options.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/config/unset.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/config/unset.py)_\n\n### `lean create-project`\n\nAlias for 'project-create'\n\n```\nUsage: lean create-project [OPTIONS] NAME\n\n Create a new project containing starter code.\n\n If NAME is a path containing subdirectories those will be created automatically.\n\n The default language can be set using `lean config set default-language python/csharp`.\n\nOptions:\n -l, --language [python|csharp] The language of the project to create\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/create_project.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/create_project.py)_\n\n### `lean data download`\n\nPurchase and download data directly from QuantConnect or download from Support Data Providers\n\n```\nUsage: lean data download [OPTIONS]\n\n Purchase and download data directly from QuantConnect or download from Support Data Providers\n\n 1. Acquire Data from QuantConnect Datasets: Purchase and seamlessly download data directly from QuantConnect.\n\n 2. Streamlined Access from Support Data Providers:\n\n - Choose your preferred historical data provider.\n\n - Initiate hassle-free downloads from our supported providers.\n\n We have 2 options:\n\n - interactive (follow instruction in lean-cli)\n\n - no interactive (write arguments in command line)\n\n An interactive wizard will show to walk you through the process of selecting data, accepting the CLI API Access and\n Data Agreement and payment. After this wizard the selected data will be downloaded automatically.\n\n If --dataset is given the command runs in non-interactive mode. In this mode the CLI does not prompt for input or\n confirmation but only halts when the agreement must be accepted. In non-interactive mode all options specific to the\n selected dataset are required.\n\n See the following url for the data that can be purchased and downloaded with this command:\n https://www.quantconnect.com/datasets\n\nOptions:\n --data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]\n The name of the downloader data provider.\n --ib-user-name TEXT Your Interactive Brokers username\n --ib-account TEXT Your Interactive Brokers account id\n --ib-password TEXT Your Interactive Brokers password\n --ib-weekly-restart-utc-time TEXT\n Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at\n this time, and will require 2FA verification. This is required by Interactive Brokers.\n Use this option explicitly to override the default value. (Optional).\n --oanda-account-id TEXT Your OANDA account id\n --oanda-access-token TEXT Your OANDA API token\n --oanda-environment [Practice|Trade]\n The environment to run in, Practice for fxTrade Practice, Trade for fxTrade\n --bitfinex-api-key TEXT Your Bitfinex API key\n --bitfinex-api-secret TEXT Your Bitfinex API secret\n --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.\n --coinbase-api-private-key TEXT\n Your Coinbase Advanced Trade API private key from file.\n --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]\n Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]\n --binance-api-key TEXT Your Binance API key\n --binanceus-api-key TEXT Your Binance API key\n --binance-api-secret TEXT Your Binance API secret\n --binanceus-api-secret TEXT Your Binance API secret\n --kraken-api-key TEXT Your Kraken API key\n --kraken-api-secret TEXT Your Kraken API secret\n --kraken-verification-tier [Starter|Intermediate|Pro]\n Your Kraken Verification Tier\n --iqfeed-iqconnect TEXT The path to the IQConnect binary\n --iqfeed-username TEXT Your IQFeed username\n --iqfeed-password TEXT Your IQFeed password\n --iqfeed-version TEXT The product version of your IQFeed developer account\n --iqfeed-host TEXT The IQFeed host address (Optional).\n --polygon-api-key TEXT Your Polygon.io API Key\n --factset-auth-config-file FILE\n The path to the FactSet authentication configuration file\n --iex-cloud-api-key TEXT Your iexcloud.io API token publishable key\n --iex-price-plan [Launch|Grow|Enterprise]\n Your IEX Cloud Price plan\n --alpha-vantage-api-key TEXT Your Alpha Vantage Api Key\n --alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]\n Your Alpha Vantage Premium API Key plan\n --coinapi-api-key TEXT Your coinapi.io Api Key\n --coinapi-product [Free|Startup|Streamer|Professional|Enterprise]\n CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)\n --thetadata-ws-url TEXT The ThetaData host address (Optional).\n --thetadata-rest-url TEXT The ThetaData host address (Optional).\n --thetadata-subscription-plan [Free|Value|Standard|Pro]\n Your ThetaData subscription price plan\n --terminal-link-connection-type [DAPI|SAPI]\n Terminal Link Connection Type [DAPI, SAPI]\n --terminal-link-environment [Production|Beta]\n The environment to run in\n --terminal-link-server-host TEXT\n The host of the TerminalLink server\n --terminal-link-server-port INTEGER\n The port of the TerminalLink server\n --terminal-link-openfigi-api-key TEXT\n The Open FIGI API key to use for mapping options\n --terminal-link-server-auth-id TEXT\n The Auth ID of the TerminalLink server\n --bybit-api-key TEXT Your Bybit API key\n --bybit-api-secret TEXT Your Bybit API secret\n --trade-station-environment [live|paper]\n Whether Live or Paper environment should be used\n --trade-station-account-id TEXT\n The TradeStation account Id\n --alpaca-environment [live|paper]\n Whether Live or Paper environment should be used\n --dataset TEXT The name of the dataset to download non-interactively\n --overwrite Overwrite existing local data\n -y, --yes Automatically confirm payment confirmation prompts\n --data-type [Trade|Quote|Bulk|OpenInterest]\n Specify the type of historical data\n --resolution [Tick|Second|Minute|Hour|Daily]\n Specify the resolution of the historical data\n --security-type [Equity|Index|Forex|Cfd|Future|Crypto|CryptoFuture|Option|IndexOption|Commodity|FutureOption]\n Specify the security type of the historical data\n --market TEXT Specify the market name for tickers (e.g., 'USA', 'NYMEX', 'Binance') (if not provided\n or empty the default market for the requested security type will be used)\n --ticker TEXT Specify comma separated list of tickers to use for historical data request.\n --start TEXT Specify the start date for the historical data request in the format yyyyMMdd.\n --end TEXT Specify the end date for the historical data request in the format yyyyMMdd. (defaults\n to today)\n --image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)\n --update Pull the LEAN engine image before running the Downloader Data Provider\n --no-update Use the local LEAN engine image instead of pulling the latest version\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/data/download.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/data/download.py)_\n\n### `lean data generate`\n\nGenerate random market data.\n\n```\nUsage: lean data generate [OPTIONS]\n\n Generate random market data.\n\n This uses the random data generator in LEAN to generate realistic market data using a Brownian motion model.\n This generator supports the following security types, tick types and resolutions:\n | Security type | Generated tick types | Supported resolutions |\n | ------------- | -------------------- | ------------------------------------ |\n | Equity | Trade | Tick, Second, Minute, Hour and Daily |\n | Forex | Quote | Tick, Second, Minute, Hour and Daily |\n | CFD | Quote | Tick, Second, Minute, Hour and Daily |\n | Future | Trade and Quote | Tick, Second, Minute, Hour and Daily |\n | Crypto | Trade and Quote | Tick, Second, Minute, Hour and Daily |\n | Option | Trade and Quote | Minute |\n\n The following data densities are available:\n - Dense: at least one data point per resolution step.\n - Sparse: at least one data point per 5 resolution steps.\n - VerySparse: at least one data point per 50 resolution steps.\n\n Example which generates minute data for 100 equity symbols since 2015-01-01:\n $ lean data generate --start=20150101 --symbol-count=100\n\n Example which generates daily data for 100 crypto symbols since 2015-01-01:\n $ lean data generate --start=20150101 --symbol-count=100 --security-type=Crypto --resolution=Daily\n\n By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you\n can set the default engine image for all commands using `lean config set engine-image <image>`.\n\nOptions:\n --start [yyyyMMdd] Start date for the data to generate in yyyyMMdd format [required]\n --end [yyyyMMdd] End date for the data to generate in yyyyMMdd format (defaults to today)\n --symbol-count INTEGER RANGE The number of symbols to generate data for [x>=0]\n --tickers TEXT Comma separated list of tickers to use for generated data\n --security-type [Equity|Forex|Cfd|Future|Crypto|Option]\n The security type to generate data for (defaults to Equity)\n --resolution [Tick|Second|Minute|Hour|Daily]\n The resolution of the generated data (defaults to Minute)\n --data-density [Dense|Sparse|VerySparse]\n The density of the generated data (defaults to Dense)\n --include-coarse BOOLEAN Whether coarse universe data should be generated for Equity data (defaults to True)\n --market TEXT The market to generate data for (defaults to standard market for the security type)\n --quote-trade-ratio FLOAT The ratio of generated quotes to generated trades. Values larger than 1 mean more\n quotes than trades. Only used for Option, Future and Crypto (defaults to 1)\n --random-seed INTEGER RANGE The random number generator seed. Defaults to None, which means no seed will be used\n [x>=0]\n --ipo-percentage FLOAT The probability each equity generated will have an IPO event. Note that this is not\n the total probability for all symbols generated. Only used for Equity (defaults to\n 5.0)\n --rename-percentage FLOAT The probability each equity generated will have a rename event. Note that this is not\n the total probability for all symbols generated. Only used for Equity (defaults to\n 30.0)\n --splits-percentage FLOAT The probability each equity generated will have a stock split event. Note that this is\n not the total probability for all symbols generated. Only used for Equity (defaults to\n 15.0)\n --dividends-percentage FLOAT The probability each equity generated will have dividends. Note that this is not the\n probability for all symbols genearted. Only used for Equity (defaults to 60.0)\n --dividend-every-quarter-percentage FLOAT\n The probability each equity generated will have a dividend event every quarter. Note\n that this is not the total probability for all symbols generated. Only used for Equity\n (defaults to 30.0)\n --option-price-engine TEXT The stochastic process, and returns new pricing engine to run calculations for that\n option (defaults to BaroneAdesiWhaleyApproximationEngine)\n --volatility-model-resolution [Tick|Second|Minute|Hour|Daily]\n The volatility model period span (defaults to Daily)\n --chain-symbol-count INTEGER RANGE\n The size of the option chain (defaults to 10) [x>=0]\n --image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)\n --update Pull the LEAN engine image before running the generator\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/data/generate.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/data/generate.py)_\n\n### `lean decrypt`\n\nDecrypt your local project using the specified decryption key.\n\n```\nUsage: lean decrypt [OPTIONS] PROJECT\n\n Decrypt your local project using the specified decryption key.\n\nOptions:\n --key FILE Path to the decryption key to use\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/decrypt.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/decrypt.py)_\n\n### `lean delete-project`\n\nAlias for 'project-delete'\n\n```\nUsage: lean delete-project [OPTIONS] PROJECT\n\n Delete a project locally and in the cloud if it exists.\n\n The project is selected by name or cloud id.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/delete_project.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/delete_project.py)_\n\n### `lean encrypt`\n\nEncrypt your local project using the specified encryption key.\n\n```\nUsage: lean encrypt [OPTIONS] PROJECT\n\n Encrypt your local project using the specified encryption key.\n\nOptions:\n --key FILE Path to the encryption key to use\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/encrypt.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/encrypt.py)_\n\n### `lean init`\n\nScaffold a Lean configuration file and data directory.\n\n```\nUsage: lean init [OPTIONS]\n\n Scaffold a Lean configuration file and data directory.\n\nOptions:\n --organization TEXT The name or id of the organization the Lean CLI will be scaffolded for\n -l, --language [python|csharp] The default language to use for new projects\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/init.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/init.py)_\n\n### `lean library add`\n\nAdd a custom library to a project.\n\n```\nUsage: lean library add [OPTIONS] PROJECT NAME\n\n Add a custom library to a project.\n\n PROJECT must be the path to the project.\n\n NAME must be either the name of a NuGet package (for C# projects), a PyPI package (for Python projects), or a path to\n a Lean CLI library.\n\n If --version is not given, and the library is a NuGet or PyPI package the package, it is pinned to the latest\n compatible version. For C# projects, this is the latest available version. For Python projects, this is the latest\n version compatible with Python 3.8 (which is what the Docker images use). For Lean CLI library projects, this is\n ignored.\n\n Custom C# libraries are added to your project's .csproj file, which is then restored if dotnet is on your PATH and the\n --no-local flag has not been given.\n\n Custom Python libraries are added to your project's requirements.txt file and are installed in your local Python\n environment so you get local autocomplete for the library. The last step can be skipped with the --no-local flag.\n\n C# example usage:\n $ lean library add \"My CSharp Project\" Microsoft.ML\n $ lean library add \"My CSharp Project\" Microsoft.ML --version 1.5.5\n $ lean library add \"My CSharp Project\" \"Library/My CSharp Library\"\n\n Python example usage:\n $ lean library add \"My Python Project\" tensorflow\n $ lean library add \"My Python Project\" tensorflow --version 2.5.0\n $ lean library add \"My Python Project\" \"Library/My Python Library\"\n\nOptions:\n --version TEXT The version of the library to add (defaults to latest compatible version)\n --no-local Skip making changes to your local environment\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/library/add.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/library/add.py)_\n\n### `lean library remove`\n\nRemove a custom library from a project.\n\n```\nUsage: lean library remove [OPTIONS] PROJECT NAME\n\n Remove a custom library from a project.\n\n PROJECT must be the path to the project directory.\n\n NAME must be either the name of the NuGet package (for C# projects), the PyPI package (for Python projects), or the\n path to the Lean CLI library to remove.\n\n Custom C# libraries are removed from the project's .csproj file, which is then restored if dotnet is on your PATH and\n the --no-local flag has not been given.\n\n Custom Python libraries are removed from the project's requirements.txt file.\n\n C# example usage:\n $ lean library remove \"My CSharp Project\" Microsoft.ML\n\n Python example usage:\n $ lean library remove \"My Python Project\" tensorflow\n\nOptions:\n --no-local Skip making changes to your local environment\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/library/remove.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/library/remove.py)_\n\n### `lean live`\n\nInteract with the local machine.\n\n```\nUsage: lean live [OPTIONS] COMMAND [ARGS]...\n\n Interact with the local machine.\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n add-security Represents a command to add a security to the algorithm.\n cancel-order Represents a command to cancel a specific order by id.\n command Send a command to a local running live trading project.\n deploy Start live trading a project locally using Docker.\n liquidate Liquidate the given symbol from the latest deployment of the given project.\n stop Stop an already running local live trading project.\n submit-order Represents a command to submit an order to the algorithm.\n update-order Represents a command to update a specific order by id.\n```\n\n### `lean live add-security`\n\nRepresents a command to add a security to the algorithm.\n\n```\nUsage: lean live add-security [OPTIONS] PROJECT\n\n Represents a command to add a security to the algorithm.\n\nOptions:\n --ticker TEXT The ticker of the symbol to add [required]\n --market TEXT The market of the symbol to add [required]\n --security-type TEXT The security type of the symbol to add [required]\n --resolution TEXT The resolution of the symbol to add\n --fill-data-forward The fill forward behavior, true to fill forward, false otherwise - defaults to true\n --leverage DECIMAL The leverage for the security, defaults to 2 for equity, 50 for forex, and 1 for everything\n else\n --extended-market-hours The extended market hours flag, true to allow pre/post market data, false for only in market\n data\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/add_security.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/add_security.py)_\n\n### `lean live cancel-order`\n\nRepresents a command to cancel a specific order by id.\n\n```\nUsage: lean live cancel-order [OPTIONS] PROJECT\n\n Represents a command to cancel a specific order by id.\n\nOptions:\n --order-id INTEGER The order id to be cancelled [required]\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/cancel_order.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/cancel_order.py)_\n\n### `lean live command`\n\nSend a command to a local running live trading project.\n\n```\nUsage: lean live command [OPTIONS] PROJECT\n\n Send a command to a local running live trading project.\n\nOptions:\n --data TEXT The command to send, 'str' representation of a 'dict' e.g. \"{ \\\"target\\\": \\\"BTCUSD\\\",\n \\\"$type\\\":\\\"MyCommand\\\" }\"\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/command.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/command.py)_\n\n### `lean live deploy`\n\nStart live trading a project locally using Docker.\n\n```\nUsage: lean live deploy [OPTIONS] PROJECT\n\n Start live trading a project locally using Docker.\n\n If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.\n If PROJECT is a file, the algorithm in the specified file will be executed.\n\n By default an interactive wizard is shown letting you configure the brokerage and live data provider to use. If\n --environment, --brokerage or --data-provider-live are given the command runs in non-interactive mode. In this mode\n the CLI does not prompt for input.\n\n If --environment is given it must be the name of a live environment in the Lean configuration.\n\n If --brokerage and --data-provider-live are given, the options specific to the given brokerage/live data provider must\n also be given. The Lean config is used as fallback when a brokerage/live data provider-specific option hasn't been\n passed in. If a required option is not given and cannot be found in the Lean config the command aborts.\n\n By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you\n can set the default engine image for all commands using `lean config set engine-image <image>`.\n\nOptions:\n --environment TEXT The environment to use\n --output DIRECTORY Directory to store results in (defaults to PROJECT/live/TIMESTAMP)\n -d, --detach Run the live deployment in a detached Docker container and return immediately\n --brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|Bybit|TradeStation|Alpaca]\n The brokerage to use\n --data-provider-live [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|IQFeed|Polygon|IEX|CoinApi|ThetaData|Custom data only|Bybit|TradeStation|Alpaca]\n The live data provider to use\n --data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Bybit|TradeStation|Alpaca]\n Update the Lean configuration file to retrieve data from the given historical provider\n --ib-user-name TEXT Your Interactive Brokers username\n --ib-account TEXT Your Interactive Brokers account id\n --ib-password TEXT Your Interactive Brokers password\n --ib-weekly-restart-utc-time TEXT\n Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at\n this time, and will require 2FA verification. This is required by Interactive Brokers.\n Use this option explicitly to override the default value. (Optional).\n --tradier-account-id TEXT Your Tradier account id\n --tradier-access-token TEXT Your Tradier access token\n --tradier-environment [live|paper]\n Whether the developer sandbox should be used\n --oanda-account-id TEXT Your OANDA account id\n --oanda-access-token TEXT Your OANDA API token\n --oanda-environment [Practice|Trade]\n The environment to run in, Practice for fxTrade Practice, Trade for fxTrade\n --bitfinex-api-key TEXT Your Bitfinex API key\n --bitfinex-api-secret TEXT Your Bitfinex API secret\n --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.\n --coinbase-api-private-key TEXT\n Your Coinbase Advanced Trade API private key from file.\n --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]\n Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]\n --binance-api-key TEXT Your Binance API key\n --binanceus-api-key TEXT Your Binance API key\n --binance-api-secret TEXT Your Binance API secret\n --binanceus-api-secret TEXT Your Binance API secret\n --binance-use-testnet [live|paper]\n Whether the testnet should be used\n --zerodha-api-key TEXT Your Kite Connect API key\n --zerodha-access-token TEXT Your Kite Connect access token\n --zerodha-product-type [mis|cnc|nrml]\n MIS if you are targeting intraday products, CNC if you are targeting delivery\n products, NRML if you are targeting carry forward products\n --zerodha-trading-segment [equity|commodity]\n EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading\n commodities on MCX\n --zerodha-history-subscription [true|false]\n Whether you have a history API subscription for Zerodha\n --samco-client-id TEXT Your Samco account Client ID\n --samco-client-password TEXT Your Samco account password\n --samco-year-of-birth TEXT Your year of birth (YYYY) registered with Samco\n --samco-product-type [mis|cnc|nrml]\n MIS if you are targeting intraday products, CNC if you are targeting delivery\n products, NRML if you are targeting carry forward products\n --samco-trading-segment [equity|commodity]\n EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading\n commodities on MCX\n --terminal-link-connection-type [DAPI|SAPI]\n Terminal Link Connection Type [DAPI, SAPI]\n --terminal-link-environment [Production|Beta]\n The environment to run in\n --terminal-link-server-host TEXT\n The host of the TerminalLink server\n --terminal-link-server-port INTEGER\n The port of the TerminalLink server\n --terminal-link-emsx-broker TEXT\n The EMSX broker to use (Optional).\n --terminal-link-emsx-account TEXT\n The EMSX account to use (Optional).\n --terminal-link-emsx-team TEXT The EMSX team to receive order events from (Optional).\n --terminal-link-openfigi-api-key TEXT\n The Open FIGI API key to use for mapping options\n --terminal-link-server-auth-id TEXT\n The Auth ID of the TerminalLink server\n --tt-user-name TEXT Your Trading Technologies username\n --tt-session-password TEXT Your Trading Technologies session password\n --tt-account-name TEXT Your Trading Technologies account name\n --tt-rest-app-key TEXT Your Trading Technologies REST app key\n --tt-rest-app-secret TEXT Your Trading Technologies REST app secret\n --tt-rest-environment TEXT The REST environment to run in\n --tt-order-routing-sender-comp-id TEXT\n The order routing sender comp id to use\n --tt-market-data-sender-comp-id TEXT\n The market data sender comp id to use\n --tt-market-data-target-comp-id TEXT\n The market data target comp id to use\n --tt-market-data-host TEXT The host of the market data server\n --tt-market-data-port TEXT The port of the market data server\n --tt-order-routing-target-comp-id TEXT\n The order routing target comp id to use\n --tt-order-routing-host TEXT The host of the order routing server\n --tt-order-routing-port TEXT The port of the order routing server\n --tt-log-fix-messages BOOLEAN Whether FIX messages should be logged (Optional).\n --kraken-api-key TEXT Your Kraken API key\n --kraken-api-secret TEXT Your Kraken API secret\n --kraken-verification-tier [Starter|Intermediate|Pro]\n Your Kraken Verification Tier\n --tdameritrade-api-key TEXT Your TDAmeritrade API key\n --tdameritrade-access-token TEXT\n Your TDAmeritrade OAuth Access Token\n --tdameritrade-account-number TEXT\n Your TDAmeritrade account number\n --bybit-api-key TEXT Your Bybit API key\n --bybit-api-secret TEXT Your Bybit API secret\n --bybit-vip-level [VIP0|VIP1|VIP2|VIP3|VIP4|VIP5|SupremeVIP|Pro1|Pro2|Pro3|Pro4|Pro5]\n Your Bybit VIP Level\n --bybit-use-testnet [live|paper]\n Whether the testnet should be used\n --trade-station-environment [live|paper]\n Whether Live or Paper environment should be used\n --trade-station-account-id TEXT\n The TradeStation account Id\n --alpaca-environment [live|paper]\n Whether Live or Paper environment should be used\n --ib-enable-delayed-streaming-data BOOLEAN\n Whether delayed data may be used when your algorithm subscribes to a security you\n don't have a market data subscription for (Optional).\n --iqfeed-iqconnect TEXT The path to the IQConnect binary\n --iqfeed-username TEXT Your IQFeed username\n --iqfeed-password TEXT Your IQFeed password\n --iqfeed-version TEXT The product version of your IQFeed developer account\n --iqfeed-host TEXT The IQFeed host address (Optional).\n --polygon-api-key TEXT Your Polygon.io API Key\n --iex-cloud-api-key TEXT Your iexcloud.io API token publishable key\n --iex-price-plan [Launch|Grow|Enterprise]\n Your IEX Cloud Price plan\n --coinapi-api-key TEXT Your coinapi.io Api Key\n --coinapi-product [Free|Startup|Streamer|Professional|Enterprise]\n CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)\n --thetadata-ws-url TEXT The ThetaData host address (Optional).\n --thetadata-rest-url TEXT The ThetaData host address (Optional).\n --thetadata-subscription-plan [Free|Value|Standard|Pro]\n Your ThetaData subscription price plan\n --alpaca-api-key TEXT Your Alpaca Api Key\n --alpaca-api-secret TEXT Your Alpaca Api Secret\n --factset-auth-config-file FILE\n The path to the FactSet authentication configuration file\n --alpha-vantage-api-key TEXT Your Alpha Vantage Api Key\n --alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]\n Your Alpha Vantage Premium API Key plan\n --release Compile C# projects in release configuration instead of debug\n --image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)\n --python-venv TEXT The path of the python virtual environment to be used\n --live-cash-balance TEXT A comma-separated list of currency:amount pairs of initial cash balance\n --live-holdings TEXT A comma-separated list of symbol:symbolId:quantity:averagePrice of initial portfolio\n holdings\n --update Pull the LEAN engine image before starting live trading\n --show-secrets Show secrets as they are input\n --extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-\n py.readthedocs.io/en/stable/containers.html\n --no-update Use the local LEAN engine image instead of pulling the latest version\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/deploy.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/deploy.py)_\n\n### `lean live liquidate`\n\nLiquidate the given symbol from the latest deployment of the given project.\n\n```\nUsage: lean live liquidate [OPTIONS] PROJECT\n\n Liquidate the given symbol from the latest deployment of the given project.\n\nOptions:\n --ticker TEXT The ticker of the symbol to liquidate\n --market TEXT The market of the symbol to liquidate\n --security-type TEXT The security type of the symbol to liquidate\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/liquidate.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/liquidate.py)_\n\n### `lean live stop`\n\nStop an already running local live trading project.\n\n```\nUsage: lean live stop [OPTIONS] PROJECT\n\n Stop an already running local live trading project.\n\nOptions:\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/stop.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/stop.py)_\n\n### `lean live submit-order`\n\nRepresents a command to submit an order to the algorithm.\n\n```\nUsage: lean live submit-order [OPTIONS] PROJECT\n\n Represents a command to submit an order to the algorithm.\n\nOptions:\n --ticker TEXT The ticker of the symbol to be submitted [required]\n --market TEXT The market of the symbol to be submitted [required]\n --security-type TEXT The security type of the symbol to be submitted [required]\n --order-type TEXT The order type to be submitted [required]\n --quantity DECIMAL The number of units to be ordered (directional) [required]\n --limit-price DECIMAL The limit price of the order be submitted\n --stop-price DECIMAL The stop price of the order to be submitted\n --tag TEXT The tag to be attached to the order\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/submit_order.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/submit_order.py)_\n\n### `lean live update-order`\n\nRepresents a command to update a specific order by id.\n\n```\nUsage: lean live update-order [OPTIONS] PROJECT\n\n Represents a command to update a specific order by id.\n\nOptions:\n --order-id INTEGER The order id to be updated [required]\n --quantity DECIMAL The number of units to be updated (directional)\n --limit-price DECIMAL The limit price of the order to be updated\n --stop-price DECIMAL The stop price of the order to be updated\n --tag TEXT The tag to be attached to the order\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/live/update_order.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/live/update_order.py)_\n\n### `lean login`\n\nLog in with a QuantConnect account.\n\n```\nUsage: lean login [OPTIONS]\n\n Log in with a QuantConnect account.\n\n If user id or API token is not provided an interactive prompt will show.\n\n Credentials are stored in ~/.lean/credentials and are removed upon running `lean logout`.\n\nOptions:\n -u, --user-id TEXT QuantConnect user id\n -t, --api-token TEXT QuantConnect API token\n --show-secrets Show secrets as they are input\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/login.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/login.py)_\n\n### `lean logout`\n\nLog out and remove stored credentials.\n\n```\nUsage: lean logout [OPTIONS]\n\n Log out and remove stored credentials.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/logout.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/logout.py)_\n\n### `lean logs`\n\nDisplay the most recent backtest/live/optimization logs.\n\n```\nUsage: lean logs [OPTIONS]\n\n Display the most recent backtest/live/optimization logs.\n\nOptions:\n --backtest Display the most recent backtest logs (default)\n --live Display the most recent live logs\n --optimization Display the most recent optimization logs\n --project DIRECTORY The project to get the most recent logs from\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/logs.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/logs.py)_\n\n### `lean object-store delete`\n\nOpens the local storage directory in the file explorer.\n\n```\nUsage: lean object-store delete [OPTIONS]\n\n Opens the local storage directory in the file explorer.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/object_store/delete.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/delete.py)_\n\n### `lean object-store get`\n\nOpens the local storage directory in the file explorer.\n\n```\nUsage: lean object-store get [OPTIONS]\n\n Opens the local storage directory in the file explorer.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/object_store/get.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/get.py)_\n\n### `lean object-store list`\n\nOpens the local storage directory in the file explorer.\n\n```\nUsage: lean object-store list [OPTIONS]\n\n Opens the local storage directory in the file explorer.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/object_store/list.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/list.py)_\n\n### `lean object-store ls`\n\nAlias for 'list'\n\n```\nUsage: lean object-store ls [OPTIONS]\n\n Opens the local storage directory in the file explorer.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/object_store/ls.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/ls.py)_\n\n### `lean object-store properties`\n\nOpens the local storage directory in the file explorer.\n\n```\nUsage: lean object-store properties [OPTIONS]\n\n Opens the local storage directory in the file explorer.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/object_store/properties.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/properties.py)_\n\n### `lean object-store set`\n\nOpens the local storage directory in the file explorer.\n\n```\nUsage: lean object-store set [OPTIONS]\n\n Opens the local storage directory in the file explorer.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/object_store/set.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/object_store/set.py)_\n\n### `lean optimize`\n\nOptimize a project's parameters locally using Docker.\n\n```\nUsage: lean optimize [OPTIONS] PROJECT\n\n Optimize a project's parameters locally using Docker.\n\n If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.\n If PROJECT is a file, the algorithm in the specified file will be executed.\n\n By default an interactive wizard is shown letting you configure the optimizer. If --optimizer-config or --strategy is\n given the command runs in non-interactive mode. In this mode the CLI does not prompt for input.\n\n The --optimizer-config option can be used to specify the configuration to run the optimizer with.\n When using the option it should point to a file like this (the algorithm-* properties should be omitted):\n https://github.com/QuantConnect/Lean/blob/master/Optimizer.Launcher/config.json\n\n If --strategy is given the optimizer configuration is read from the given options. In this case --strategy, --target,\n --target-direction and --parameter become required.\n\n In non-interactive mode the --parameter option can be provided multiple times to configure multiple parameters:\n - --parameter <name> <min value> <max value> <step size>\n - --parameter my-first-parameter 1 10 0.5 --parameter my-second-parameter 20 30 5\n\n In non-interactive mode the --constraint option can be provided multiple times to configure multiple constraints:\n - --constraint \"<statistic> <operator> <value>\"\n - --constraint \"Sharpe Ratio >= 0.5\" --constraint \"Drawdown < 0.25\"\n\n If --estimate is given, the optimization will not be executed.\n The runtime estimate for the optimization will be calculated and outputted.\n\n By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you\n can set the default engine image for all commands using `lean config set engine-image <image>`.\n\nOptions:\n --output DIRECTORY Directory to store results in (defaults to PROJECT/optimizations/TIMESTAMP)\n -d, --detach Run the optimization in a detached Docker container and return immediately\n --optimizer-config FILE The optimizer configuration file that should be used\n --strategy [Grid Search|Euler Search]\n The optimization strategy to use\n --target TEXT The target statistic of the optimization\n --target-direction [min|max] Whether the target must be minimized or maximized\n --parameter <TEXT FLOAT FLOAT FLOAT>...\n The 'parameter min max step' pairs configuring the parameters to optimize\n --constraint TEXT The 'statistic operator value' pairs configuring the constraints of the optimization\n --data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]\n Update the Lean configuration file to retrieve data from the given historical provider\n --download-data Update the Lean configuration file to download data from the QuantConnect API, alias\n for --data-provider-historical QuantConnect\n --data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the backtest when using\n QuantConnect as historical data provider\n --release Compile C# projects in release configuration instead of debug\n --image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)\n --update Pull the LEAN engine image before running the optimizer\n --estimate Estimate optimization runtime without running it\n --max-concurrent-backtests INTEGER RANGE\n Maximum number of concurrent backtests to run [x>=1]\n --extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-\n py.readthedocs.io/en/stable/containers.html\n --no-update Use the local LEAN engine image instead of pulling the latest version\n --ib-user-name TEXT Your Interactive Brokers username\n --ib-account TEXT Your Interactive Brokers account id\n --ib-password TEXT Your Interactive Brokers password\n --ib-weekly-restart-utc-time TEXT\n Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at\n this time, and will require 2FA verification. This is required by Interactive Brokers.\n Use this option explicitly to override the default value. (Optional).\n --oanda-account-id TEXT Your OANDA account id\n --oanda-access-token TEXT Your OANDA API token\n --oanda-environment [Practice|Trade]\n The environment to run in, Practice for fxTrade Practice, Trade for fxTrade\n --bitfinex-api-key TEXT Your Bitfinex API key\n --bitfinex-api-secret TEXT Your Bitfinex API secret\n --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.\n --coinbase-api-private-key TEXT\n Your Coinbase Advanced Trade API private key from file.\n --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]\n Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]\n --binance-api-key TEXT Your Binance API key\n --binanceus-api-key TEXT Your Binance API key\n --binance-api-secret TEXT Your Binance API secret\n --binanceus-api-secret TEXT Your Binance API secret\n --kraken-api-key TEXT Your Kraken API key\n --kraken-api-secret TEXT Your Kraken API secret\n --kraken-verification-tier [Starter|Intermediate|Pro]\n Your Kraken Verification Tier\n --iqfeed-iqconnect TEXT The path to the IQConnect binary\n --iqfeed-username TEXT Your IQFeed username\n --iqfeed-password TEXT Your IQFeed password\n --iqfeed-version TEXT The product version of your IQFeed developer account\n --iqfeed-host TEXT The IQFeed host address (Optional).\n --polygon-api-key TEXT Your Polygon.io API Key\n --factset-auth-config-file FILE\n The path to the FactSet authentication configuration file\n --iex-cloud-api-key TEXT Your iexcloud.io API token publishable key\n --iex-price-plan [Launch|Grow|Enterprise]\n Your IEX Cloud Price plan\n --alpha-vantage-api-key TEXT Your Alpha Vantage Api Key\n --alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]\n Your Alpha Vantage Premium API Key plan\n --coinapi-api-key TEXT Your coinapi.io Api Key\n --coinapi-product [Free|Startup|Streamer|Professional|Enterprise]\n CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)\n --thetadata-ws-url TEXT The ThetaData host address (Optional).\n --thetadata-rest-url TEXT The ThetaData host address (Optional).\n --thetadata-subscription-plan [Free|Value|Standard|Pro]\n Your ThetaData subscription price plan\n --terminal-link-connection-type [DAPI|SAPI]\n Terminal Link Connection Type [DAPI, SAPI]\n --terminal-link-environment [Production|Beta]\n The environment to run in\n --terminal-link-server-host TEXT\n The host of the TerminalLink server\n --terminal-link-server-port INTEGER\n The port of the TerminalLink server\n --terminal-link-openfigi-api-key TEXT\n The Open FIGI API key to use for mapping options\n --terminal-link-server-auth-id TEXT\n The Auth ID of the TerminalLink server\n --bybit-api-key TEXT Your Bybit API key\n --bybit-api-secret TEXT Your Bybit API secret\n --trade-station-environment [live|paper]\n Whether Live or Paper environment should be used\n --trade-station-account-id TEXT\n The TradeStation account Id\n --alpaca-environment [live|paper]\n Whether Live or Paper environment should be used\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/optimize.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/optimize.py)_\n\n### `lean private-cloud add-compute`\n\nAdd private cloud compute\n\n```\nUsage: lean private-cloud add-compute [OPTIONS]\n\n Add private cloud compute\n\nOptions:\n --token TEXT The master server token\n --master-domain, --master-ip TEXT\n The master server domain\n --master-port INTEGER The master server port\n --slave-domain, --slave-ip TEXT\n The slave server domain\n --update Pull the latest image before starting\n --no-update Do not update to the latest version\n --compute TEXT Compute configuration to use\n --extra-docker-config TEXT Extra docker configuration as a JSON string\n --stop Stop any existing deployment\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/private_cloud/add_compute.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/private_cloud/add_compute.py)_\n\n### `lean private-cloud start`\n\nStart a new private cloud\n\n```\nUsage: lean private-cloud start [OPTIONS]\n\n Start a new private cloud\n\nOptions:\n --master Run in master mode\n --slave Run in slave mode\n --token TEXT The master server token\n --master-domain, --master-ip TEXT\n The master server domain\n --master-port INTEGER The master server port\n --slave-domain, --slave-ip TEXT\n The slave server domain\n --update Pull the latest image before starting\n --no-update Do not update to the latest version\n --compute TEXT Compute configuration to use\n --extra-docker-config TEXT Extra docker configuration as a JSON string\n --stop Stop any existing deployment\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/private_cloud/start.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/private_cloud/start.py)_\n\n### `lean private-cloud stop`\n\nStops a running private cloud\n\n```\nUsage: lean private-cloud stop [OPTIONS]\n\n Stops a running private cloud\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/private_cloud/stop.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/private_cloud/stop.py)_\n\n### `lean project-create`\n\nCreate a new project containing starter code.\n\n```\nUsage: lean project-create [OPTIONS] NAME\n\n Create a new project containing starter code.\n\n If NAME is a path containing subdirectories those will be created automatically.\n\n The default language can be set using `lean config set default-language python/csharp`.\n\nOptions:\n -l, --language [python|csharp] The language of the project to create\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/project_create.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/project_create.py)_\n\n### `lean project-delete`\n\nDelete a project locally and in the cloud if it exists.\n\n```\nUsage: lean project-delete [OPTIONS] PROJECT\n\n Delete a project locally and in the cloud if it exists.\n\n The project is selected by name or cloud id.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/project_delete.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/project_delete.py)_\n\n### `lean report`\n\nGenerate a report of a backtest.\n\n```\nUsage: lean report [OPTIONS]\n\n Generate a report of a backtest.\n\n This runs the LEAN Report Creator in Docker to generate a polished, professional-grade report of a backtest.\n\n If --backtest-results is not given, a report is generated for the most recent local backtest.\n\n The name, description, and version are optional and will be blank if not given.\n\n If the given backtest data source file is stored in a project directory (or one of its subdirectories, like the\n default <project>/backtests/<timestamp>), the default name is the name of the project directory and the default\n description is the description stored in the project's config.json file.\n\n By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you\n can set the default engine image for all commands using `lean config set engine-image <image>`.\n\nOptions:\n --backtest-results FILE Path to the JSON file containing the backtest results\n --live-results FILE Path to the JSON file containing the live trading results\n --report-destination FILE Path where the generated report is stored as HTML (defaults to ./report.html)\n --css FILE Path where the CSS override file is stored\n --html FILE Path where the custom HTML template file is stored\n -d, --detach Run the report creator in a detached Docker container and return immediately\n --strategy-name TEXT Name of the strategy, will appear at the top-right corner of each page\n --strategy-version TEXT Version number of the strategy, will appear next to the project name\n --strategy-description TEXT Description of the strategy, will appear under the 'Strategy Description' section\n --overwrite Overwrite --report-destination if it already contains a file\n --image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)\n --update Pull the LEAN engine image before running the report creator\n --pdf Create a PDF version along with the HTML version of the report\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/report.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/report.py)_\n\n### `lean research`\n\nRun a Jupyter Lab environment locally using Docker.\n\n```\nUsage: lean research [OPTIONS] PROJECT\n\n Run a Jupyter Lab environment locally using Docker.\n\n By default the official LEAN research image is used. You can override this using the --image option. Alternatively you\n can set the default research image using `lean config set research-image <image>`.\n\nOptions:\n --port INTEGER The port to run Jupyter Lab on (defaults to 8888)\n --data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]\n Update the Lean configuration file to retrieve data from the given historical provider\n --ib-user-name TEXT Your Interactive Brokers username\n --ib-account TEXT Your Interactive Brokers account id\n --ib-password TEXT Your Interactive Brokers password\n --ib-weekly-restart-utc-time TEXT\n Weekly restart UTC time (hh:mm:ss). Each week on Sunday your algorithm is restarted at\n this time, and will require 2FA verification. This is required by Interactive Brokers.\n Use this option explicitly to override the default value. (Optional).\n --oanda-account-id TEXT Your OANDA account id\n --oanda-access-token TEXT Your OANDA API token\n --oanda-environment [Practice|Trade]\n The environment to run in, Practice for fxTrade Practice, Trade for fxTrade\n --bitfinex-api-key TEXT Your Bitfinex API key\n --bitfinex-api-secret TEXT Your Bitfinex API secret\n --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file.\n --coinbase-api-private-key TEXT\n Your Coinbase Advanced Trade API private key from file.\n --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures]\n Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures]\n --binance-api-key TEXT Your Binance API key\n --binanceus-api-key TEXT Your Binance API key\n --binance-api-secret TEXT Your Binance API secret\n --binanceus-api-secret TEXT Your Binance API secret\n --kraken-api-key TEXT Your Kraken API key\n --kraken-api-secret TEXT Your Kraken API secret\n --kraken-verification-tier [Starter|Intermediate|Pro]\n Your Kraken Verification Tier\n --iqfeed-iqconnect TEXT The path to the IQConnect binary\n --iqfeed-username TEXT Your IQFeed username\n --iqfeed-password TEXT Your IQFeed password\n --iqfeed-version TEXT The product version of your IQFeed developer account\n --iqfeed-host TEXT The IQFeed host address (Optional).\n --polygon-api-key TEXT Your Polygon.io API Key\n --factset-auth-config-file FILE\n The path to the FactSet authentication configuration file\n --iex-cloud-api-key TEXT Your iexcloud.io API token publishable key\n --iex-price-plan [Launch|Grow|Enterprise]\n Your IEX Cloud Price plan\n --alpha-vantage-api-key TEXT Your Alpha Vantage Api Key\n --alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]\n Your Alpha Vantage Premium API Key plan\n --coinapi-api-key TEXT Your coinapi.io Api Key\n --coinapi-product [Free|Startup|Streamer|Professional|Enterprise]\n CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)\n --thetadata-ws-url TEXT The ThetaData host address (Optional).\n --thetadata-rest-url TEXT The ThetaData host address (Optional).\n --thetadata-subscription-plan [Free|Value|Standard|Pro]\n Your ThetaData subscription price plan\n --terminal-link-connection-type [DAPI|SAPI]\n Terminal Link Connection Type [DAPI, SAPI]\n --terminal-link-environment [Production|Beta]\n The environment to run in\n --terminal-link-server-host TEXT\n The host of the TerminalLink server\n --terminal-link-server-port INTEGER\n The port of the TerminalLink server\n --terminal-link-openfigi-api-key TEXT\n The Open FIGI API key to use for mapping options\n --terminal-link-server-auth-id TEXT\n The Auth ID of the TerminalLink server\n --bybit-api-key TEXT Your Bybit API key\n --bybit-api-secret TEXT Your Bybit API secret\n --trade-station-environment [live|paper]\n Whether Live or Paper environment should be used\n --trade-station-account-id TEXT\n The TradeStation account Id\n --alpaca-environment [live|paper]\n Whether Live or Paper environment should be used\n --download-data Update the Lean configuration file to download data from the QuantConnect API, alias\n for --data-provider-historical QuantConnect\n --data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the research session\n when using QuantConnect as historical data provider\n -d, --detach Run Jupyter Lab in a detached Docker container and return immediately\n --no-open Don't open the Jupyter Lab environment in the browser after starting it\n --image TEXT The LEAN research image to use (defaults to quantconnect/research:latest)\n --update Pull the LEAN research image before starting the research environment\n --extra-docker-config TEXT Extra docker configuration as a JSON string. For more information https://docker-\n py.readthedocs.io/en/stable/containers.html\n --no-update Use the local LEAN research image instead of pulling the latest version\n --lean-config FILE The Lean configuration file that should be used (defaults to the nearest lean.json)\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/research.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/research.py)_\n\n### `lean whoami`\n\nDisplay who is logged in.\n\n```\nUsage: lean whoami [OPTIONS]\n\n Display who is logged in.\n\nOptions:\n --verbose Enable debug logging\n --help Show this message and exit.\n```\n\n_See code: [lean/commands/whoami.py](https://github.com/QuantConnect/lean-cli/blob/master/lean/commands/whoami.py)_\n<!-- commands end -->\n\n## Development\n\nTo work on the Lean CLI, clone the repository, enter an environment containing Python 3.7+ and run `pip install -r requirements.txt`. This command will install the required dependencies and installs the CLI in editable mode. This means you'll be able to edit the code and immediately see the results the next time you run `lean`.\n\nIf you need to add dependencies, first update `setup.py` (if it is a production dependency) or `requirements.txt` (if it is a development dependency) and then re-run `pip install -r requirements.txt`.\n\nThe automated tests can be ran by running `pytest`. The filesystem and HTTP requests are mocked when running tests to make sure they run in an isolated environment.\n\nCan build the lean CLI by running `python setup.py sdist bdist_wheel` from the root of the project and to install it `pip install --force-reinstall dist/lean-dev-py3-none-any.whl`. To update the commands reference part of the readme run `python scripts/readme.py` from the root of the project, after installing the new version.\n\nMaintainers can publish new releases by pushing a Git tag containing the new version to GitHub. This will trigger a GitHub Actions workflow which releases the current `master` branch to PyPI with the value of the tag as version. Make sure the version is not prefixed with \"v\".\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A CLI aimed at making it easier to run QuantConnect's LEAN engine locally and in the cloud",
"version": "1.0.211",
"project_urls": {
"Documentation": "https://www.lean.io/docs/v2/lean-cli/key-concepts/getting-started",
"Homepage": "https://lean.io/cli",
"Source": "https://github.com/QuantConnect/lean-cli"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "094a491506e882627c4562c7811907bdbe6ccb58c4c31d43dbf997df71b3febd",
"md5": "b47eb1cbc58f175cc9c40e51432fbddf",
"sha256": "61bf6418f5ba2fa6dfe92121598022ee08bd8684144a160441c8abed9ed411e9"
},
"downloads": -1,
"filename": "lean-1.0.211-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b47eb1cbc58f175cc9c40e51432fbddf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 321875,
"upload_time": "2024-12-18T19:30:37",
"upload_time_iso_8601": "2024-12-18T19:30:37.063190Z",
"url": "https://files.pythonhosted.org/packages/09/4a/491506e882627c4562c7811907bdbe6ccb58c4c31d43dbf997df71b3febd/lean-1.0.211-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "90babc8624c04da8cc1429dcd6f2b0fe430fab6a798f5e2ecb66f088f647e65c",
"md5": "7495952e9fe33ba040764e718a35d29e",
"sha256": "003dea741fd2856cd151c60b2dff54ca984cd1a59b9a5e86d836f9fcdb60c55a"
},
"downloads": -1,
"filename": "lean-1.0.211.tar.gz",
"has_sig": false,
"md5_digest": "7495952e9fe33ba040764e718a35d29e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 236932,
"upload_time": "2024-12-18T19:30:39",
"upload_time_iso_8601": "2024-12-18T19:30:39.918711Z",
"url": "https://files.pythonhosted.org/packages/90/ba/bc8624c04da8cc1429dcd6f2b0fe430fab6a798f5e2ecb66f088f647e65c/lean-1.0.211.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 19:30:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "QuantConnect",
"github_project": "lean-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "lean"
}