LEAN CLI
QuantConnect's local CLI for algorithmic trading development, backtesting, and deployment across multiple asset classes.
Install
pip install lean TL;DR: LEAN CLI is QuantConnect’s command-line tool for developing, backtesting, and deploying algorithmic trading strategies locally using the open-source LEAN engine.
LEAN CLI provides a local development environment for the QuantConnect LEAN algorithmic trading engine. You can create strategy projects, run backtests against historical data, optimize parameters, and deploy strategies to live trading, all from the terminal. The CLI scaffolds projects with proper structure, manages data downloads, and handles Docker-based execution environments to ensure consistency between local and cloud runs.
The workflow centers on writing algorithms in Python or C#, backtesting them against QuantConnect’s historical data library, analyzing results, and iterating. LEAN CLI supports multiple asset classes including US equities, options, futures, forex, and crypto. It integrates with various brokerages for live deployment including Interactive Brokers, Alpaca, Coinbase, and others. Research notebooks and parameter optimization are also available through the CLI.
LEAN CLI is aimed at quantitative developers and algorithmic traders who want to develop and test strategies locally before deploying them. It assumes familiarity with programming and quantitative concepts. Casual traders looking for simple market monitoring should consider other tools.