gitmyhub

Lean

C# ★ 21k updated 1d ago

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)

LEAN is an open-source algorithmic trading engine that lets you write, backtest, and live-trade automated strategies in Python or C# across stocks, options, forex, and more.

C#PythonDockersetup: hardcomplexity 4/5

LEAN is a professional-grade algorithmic trading platform built by QuantConnect that lets you write, test, and deploy automated trading strategies. The problem it solves: building a trading algorithm from scratch requires connecting to market data, handling order execution, managing risk, and testing your strategy against historical data — all of which are complex engineering challenges. LEAN handles all of that infrastructure so you can focus on writing your trading logic.

Here's how it works: you write a trading algorithm in Python or C#, then LEAN's event-driven engine simulates how that algorithm would have performed against real historical market data (this is called backtesting). Once you're satisfied with the results, you can switch to live trading with real money through supported brokers. The engine is modular, meaning each component — data feeds, order routing, risk models — can be swapped out or customized.

You would use this if you're a quantitative trader or developer who wants to build strategies for stocks, options, forex, or other financial instruments. It supports local development on Mac, Linux, or Windows, and integrates with QuantConnect's cloud platform. The tech stack is C# at its core, with Python support added on top, and Docker is used for local backtesting and research environments.

Where it fits