mrkeyoor.com_
Sat 12 Sept 06:26 UTC
Dataevaluationupdated 12 Sept 2026

Lean review

LEAN is an open-source engine for writing, backtesting, and running algorithmic trading strategies in C# or Python across several financial markets. It handles event sequencing, portfolios, market data, brokerage connections, and local or cloud workflows so a quant developer can work inside one trading model.

Verdict

Our Lean run installed 35 packages in 15 seconds, occupied 37 MB, and built in 5 seconds; the harness found no test target and skipped tests. Use LEAN when the same event-driven model must cover serious backtesting and live brokerage work, and your team can operate its Docker, data, and .NET layers. Choose a smaller Python library for research-only work, and require strategy-specific regression cases before letting LEAN's history or option-margin output influence real capital.

We ran it

Lab card: what happened when we ran LeanScreenshot of Lean (lean.io)
Install✓ · 15s35 packages · 37 MB
Build✓ · 5s
Testsn/ano test script
Known vulns0(pip-audit)
Repo6302 files~789,699 lines of source · 286.3 MB · 9 CI workflows · Dockerfile

Answers from our run

Does Lean build from source?

Dependencies installed in 15 seconds (35 packages), and the build succeeded in 5 seconds. We cloned commit 6eb3890 into a clean Debian container with 3 CPUs and no project-specific setup.

Does Lean have tests you can run?

Not through a standard command: the project exposes no test script or target that our harness could run.

Does Lean have known vulnerabilities in its dependencies?

pip-audit found none in the dependency tree at the time of our run.

Who should not use Lean?

Developers seeking a small Python-only backtesting library: LEAN's engine is C#, and our checkout contained 6,302 files and about 789,699 source lines.

What are the alternatives to Lean?

Backtesting.py, NautilusTrader, Backtrader. Our Lean run installed 35 packages in 15 seconds, occupied 37 MB, and built in 5 seconds; the harness found no test target and skipped tests.

Setup3/5Fast install and build; useful runs still need Docker and data
Docs4/5Broad CLI and platform guidance, but one Python link is stale
Community5/521,590 stars, a fresh push, and active issue and PR traffic
Maturity4/5Long-lived engine with live adapters and current correctness reports

Who it’s for

Quant developers who need event-driven backtests and live execution in C# or Python.
Teams that want research and live trading to share the same engine and strategy interfaces.
Engineers prepared to manage Docker, .NET, market data, and brokerage-specific configuration.
Contributors building data feeds, brokerages, portfolio models, or execution components with accompanying tests.

Who it’s NOT for

Developers seeking a small Python-only backtesting library: LEAN's engine is C#, and our checkout contained 6,302 files and about 789,699 source lines.
Workstations where Docker is prohibited: the README's local research, backtest, optimization, and live CLI commands all run through Docker.
Review processes that require an obvious root test command: our harness found no test script or target, so it skipped tests even though the repository advertises CI and regression workflows.
Options desks that will accept engine margin output without their own fixed-case checks: open issues 9775 and 9648 report understated maintenance in one unequal-wing condor and process-dependent grouping for identical holdings.
Organizations whose procurement process requires current GitHub release tags: the latest listed release is v2.4.0.1 from 2017, despite fresh development on master.

Setup reality

Our commit 6eb3890 checkout installed 35 packages in 15 seconds and used 37 MB. The build succeeded in 5 seconds. The harness found no tests script or target, so tests were skipped; pip-audit reported 0 known vulnerabilities. The repository itself had 6,302 files, about 789,699 source lines, and occupied 286.3 MB.

The recommended CLI installs through Python, then uses Docker for local research, backtests, optimization, and live trading. Direct source builds require .NET 10. Backtests need market data, while live environments add QuantConnect access details, data-provider settings, and brokerage credentials.

LEAN supports C# and Python algorithms, but the engine and source build remain C#/.NET. Our scan found 9 CI workflow files and a Dockerfile, though no tests directory. The README's repository link for detailed Python installation returned 404, so Python users should expect to rely on the main documentation and CLI path.

The C# engine supports Python strategies and .NET 10 builds

LEAN is an event-driven trading engine for backtests and live execution. Strategy authors can use C# or Python, while the engine itself is a large C#/.NET system. The README's source instructions currently call for .NET 10 on macOS and Linux, with Visual Studio on Windows. This architecture suits a team that wants explicit models for securities, orders, portfolios, data feeds, and brokerages. It is much more machinery than a researcher needs for a moving-average experiment in a notebook.

Four local CLI jobs depend on Docker

The README recommends the prebuilt Lean CLI for most users and installs it with pip install lean. Its local research, backtest, optimize, and live commands all use Docker. Project creation happens from the same terminal workflow. That is convenient when Docker is already standard on developer machines because it keeps the engine environment repeatable. A locked-down desktop, remote notebook service, or build worker that prohibits Docker needs the direct source path or a different framework.

Direct builds clone the repository, restore the solution, and run the launcher from its output directory. macOS and Linux instructions use dotnet build, while Windows points developers to Visual Studio and F5. The main README's Python section refers readers to an Algorithm.Python README that returned 404 during our check. Python strategy support remains documented elsewhere, but that dead repository path is exactly the sort of friction a new Python user meets before writing an algorithm.

What happened when we ran it

Our sandbox cloned commit 6eb3890 into an unprivileged Debian container with 3 CPUs and 8 GB of RAM. The 6,302-file checkout occupied 286.3 MB and contained about 789,699 lines of source. Installation succeeded in 15 seconds, adding 35 packages and 37 MB on disk. The build then succeeded in 5 seconds. Those figures describe repository setup in the supplied Python 3.12 image, not the time or storage needed for market data, Docker images, brokerage tools, or a backtest.

The harness found no tests script or target and skipped the test step. It also found no tests directory, while the repository contained 9 CI workflow files and a Dockerfile. The README displays build and regression workflow badges, so the skipped step should be read narrowly: our generic sandbox could not discover a supported test entry point. Pip-audit reported 0 known vulnerabilities in the installed Python packages. That audit does not inspect every .NET component in this C# engine.

The 286.3 MB checkout behaves like a platform

LEAN models many asset types, lets users replace major engine components, and carries paths for backtesting, paper trading, and live brokerages. It also leaves a large surface to understand when results look wrong. The 37 MB installed Python set from our run is a small edge of a checkout with roughly 789,699 source lines. Teams evaluating LEAN should budget time for the engine model and the data conventions, even though the 15-second install and 5-second build were short.

Dependency review also has two layers. Our Python audit returned 0 known vulnerabilities, but open issue 8795 concerns DotNetZip in the .NET compression project and cites a high-severity advisory. The issue remained open and was updated in August 2026. That does not contradict pip-audit because the tools inspect different ecosystems. A production review should scan the solution's NuGet graph as well as the Python environment, especially if external ZIP data enters the system.

A reported 17 percent history shortfall needs a regression case

Open issue 9784 reports that a daily History(barCount) request for a lunch-break market returned about 17 percent fewer bars when called while the algorithm clock sat inside the break. The reporter reproduced it on LEAN 2.5.0.0.18057 and traced the result to session-window alignment. The report was still open on September 12, 2026. Anyone trading markets with split sessions should pin a fixed history case and assert the first date, last date, and count before trusting a warmed indicator.

Option portfolios need the same skepticism. Issue 9775 reports a zero-order unequal-wing iron condor probe where native maintenance was $10,000 against a calculated $32,000 gross expiration loss. Issue 9648 separately reports process-dependent option grouping for identical holdings, with margin changing across runs in its reproducer. These are issue reports rather than findings from our sandbox. They are specific enough to justify regression fixtures for the strategies and broker models your desk will run.

Live mode starts with data rights and broker secrets

LEAN's launcher configuration includes a local data folder, QuantConnect access fields, live data endpoints, and broker-specific account or API settings. The exact requirements depend on the chosen environment. A local backtest still needs correctly formatted historical data and market metadata. Live mode adds credentials, connectivity, account reconciliation, and the behavior of the selected brokerage handler. The engine gives those concerns named interfaces; it does not make them disappear after lean live.

September activity outweighs the 2017 release tag

GitHub's latest listed release is v2.4.0.1 from August 2017, which is a poor guide to current maintenance. The repository was pushed on September 11, 2026 and had 21,590 stars with 247 combined open issues and pull requests when fetched. Issue 9784 was created on September 9 and updated through September 12. Current commits and issue discussion show active development even though formal GitHub releases do not track it.

Choose LEAN when one engine must cover research and live execution across several markets. The 15-second install and 5-second build make evaluation cheap, while the skipped test step and current correctness reports keep the acceptance bar high. Backtesting.py is a cleaner choice for contained Python research. NautilusTrader is the closer comparison for another compiled, event-driven live stack. Adoption should wait until your own data, session, fee, margin, and brokerage cases agree with independent calculations.

Alternatives

ProjectWhat it isPick it when
Backtesting.pyA focused Python library for bar-data strategy backtests and visual results.pick this instead when you need a small research API and have no plan to run the same engine against a live brokerage.
NautilusTrader gh↗A Rust-native event-driven trading engine with Python strategy and orchestration APIs.pick this instead when a compiled Rust core and multi-venue live design fit your team better than LEAN's C# stack.
BacktraderA Python backtesting and live-trading framework with indicators and broker adapters.pick this instead when an older, self-contained Python framework is easier to maintain than a large .NET engine.

What people are saying

  1. [velocity-scout] QuantConnect/Lean
  2. [hackernews] OpenAI’s Navier-Stokes release included a Lean 4 formal proof
  3. [hackernews] Fermat's Last Theorem in Lean 4
  4. [github-trending] yvgude/lean-ctx
  5. [hackernews] Palomar: A registry of Lean verified mathematics

Sources

  1. LEAN repository and README
  2. LEAN launcher configuration
  3. LEAN contributor guide
  4. LEAN issue 9784: lunch-break market history counts
  5. LEAN issue 9775: unequal-wing iron condor maintenance
  6. LEAN issue 9648: process-dependent option grouping
  7. LEAN issue 8795: DotNetZip replacement
  8. LEAN v2.4.0.1 release

More data reviews

bokeh · orm · datahub · open-source-games · lx-music-source · postgrest · the whole board →