Lumiwealth/lumibot
Backtestable AI trading agents and Python algorithmic trading strategies for stocks, options, crypto, futures, forex, SEC filings, FRED macro data, and real brokers.
Lumibot – AI‑augmented algorithmic trading framework
What it is – Lumibot is an open‑source Python library that lets you write, back‑test, paper‑trade, and live‑trade algorithmic strategies. It adds a first‑class runtime for LLM‑driven trading agents that can research market data, debate trade ideas, and place orders, all inside the same strategy loop that a deterministic Python strategy uses.
Key capabilities
| Feature | What you get |
|---|---|
| Deterministic strategies | Write plain Python logic with indicators, position sizing, risk checks, and scheduled rules. |
| AI‑agent strategies | Define multiple agents (researcher, bull, bear, trader, etc.) that call LLMs, query market tools, and optionally execute trades. |
| Backtesting | Replay historical data (Yahoo, FRED, SEC filings, etc.) and capture artefacts – order logs, charts, tear‑sheets – for inspection. |
| Paper & live trading | Switch the same strategy code to a broker (Alpaca, IBKR, Tradier, Schwab, etc.) with a single configuration change. |
| Built‑in toolset for agents | Market state, order inspection, DuckDB queries, technical indicators, news feeds, macro data, local memory, Telegram alerts, and more. |
| Managed cloud (BotSpot) | Optional hosted service that runs Lumibot bots, provides data, scheduling, monitoring, kill‑switches, and a marketplace for sharing strategies. |
| Extensible broker support | Supports Alpaca, Interactive Brokers, Tradier, Schwab, Tradovate, ProjectX, Bitunix, Polymarket, and selected CCXT exchanges. |
Typical workflow
- Write a strategy class inheriting from
lumibot.strategies.Strategy. Insideon_trading_iterationyou can call deterministic code, or invokeself.agents["name"].run(...)to let an LLM reason and return a summary. - Backtest with
MyStrategy.backtest(YahooDataBacktesting, start, end)to see how the agents would have acted on historical data. - Paper‑trade by creating a broker instance (e.g.,
Alpaca) and running the strategy withTrader().add_strategy(...).run_all(). - Go live by switching the broker config to a live account – no code changes required.
Example – a four‑agent “AI trading team” that researches ETFs, lets a bull and a bear argue, then a trader agent executes the chosen position. The README shows the full script and how to toggle between backtesting and live paper trading.
Installation
pip install lumibot
The package is on PyPI, supports Python 3.9+, and includes CI badges for test coverage.
Documentation & community
- Full docs: https://lumibot.lumiwealth.com/
- Managed cloud (BotSpot): https://botspot.trade/
- Community: GitHub repo, Reddit /r/BotSpotTrade, and a Discord server.
License – MIT.
Why it matters – Lumibot bridges the gap between experimental LLM‑driven trading ideas and production‑grade quant systems. By embedding agents in a framework that already handles backtesting, broker integration, and risk controls, users can iterate quickly, validate AI‑generated decisions on historical data, and then deploy the same code to paper or live markets with minimal friction.