Apex Backtest.
A simplified QuantConnect Lean wrapper. Write a strategy file, run one CLI command, get formatted results.
Lean is the best open-source backtesting engine in finance, but the developer experience is terrible: manual Docker setup, hand-edited JSON configs, manual data preparation in Lean's specific format (prices stored as integers ×10000), result parsing left as an exercise. New users spend their first week fighting infra instead of writing strategies.
I built apex-backtest as the wrapper I wished existed when I onboarded onto Lean. The premise: traders should write strategies, not maintain backtesting infrastructure.
A single CLI (`apex-backtest`) handles: setup (Docker readiness check, image pull), data download (yfinance → Lean format with the price-×-10000 conversion), config generation (auto-builds the JSON Lean expects), execution (mounts volumes, runs the container, captures output), and results parsing (converts Lean's stats output into a Rich-formatted terminal report).
Strategy files are vanilla Python — users write a class that subclasses `QCAlgorithm` from Lean's API. No DSL, no proprietary syntax. The wrapper ships with example strategies (SMA crossover, RSI, MACD, Bollinger) so new users have working code on day one.
yfinance instead of Lean's data feed
Lean's official data feed requires QuantConnect cloud subscription. For local backtesting, yfinance is free, sufficient, and ubiquitous. The price conversion (×10000 to fit Lean's integer format) happens once at download, transparently to the user.
Docker as a runtime boundary, not a developer tool
Most Lean tutorials make users aware of Docker (start the container, mount this volume, watch this port). apex-backtest hides Docker entirely behind the CLI — it's a runtime detail. Users who care can drop into a `docker exec`; users who don't never see a container.
Rich terminal output, not Jupyter notebooks
Most quant-tooling lives in notebooks. They're great for exploration and terrible for iteration. Rich-formatted CLI output (tables, sparklines, color-coded stats) keeps users in their terminal where they're already running git, tests, and their editor.
The best open-source backtesting engine in finance. apex-backtest hides its surface-area complexity behind a single CLI.
Modern Python CLI stack — composable commands, gorgeous formatted output. Quant tools belong in the terminal, not Jupyter notebooks.
- →Most 'developer tooling' projects underinvest in onboarding. The CLI's `setup` command (which validates Docker, pulls Lean, runs a smoke test) was the single highest-ROI feature — it converts 'this thing doesn't work' bug reports into actionable diagnostics.
- →Wrapping a powerful tool with a constrained CLI is high-leverage when the tool's surface area exceeds 99% of users' needs. Lean is enormous; apex-backtest exposes the 5% that traders actually use.