LumiBot is a free, open-source Python trading framework for building trading bots. Users can write their own trading rules, let AI agents make decisions, or combine both. Strategies can be backtested on historical data to review trades and results, and the same strategy class can be used for paper or live trading through supported brokers.
Key capabilities:
- Native AI trading: agents research, reason, and place orders based on prompts.
- Backtesting: evaluate AI decisions and Python rules on historical data, with charts, trades, and logs.
- Same strategy for backtesting and trading: keep the strategy class and only change the data source and broker runner.
- Multi-asset classes: trade stocks, options, futures, forex, cryptocurrencies, and prediction markets through supported brokers.
- Free fundamental data: SEC income statements, balance sheets, cash flow, and ready-made ratios (P/E, margins, growth), presented as known as of each date to avoid backtests seeing future information.
- Inspectable execution: decisions reach the broker, and orders, fills, and decision records can be inspected.
How to use:
- Three ways to build strategies: AI-native strategies (write prompts for trading agents), Python strategies (write rules in Python), and hybrid strategies (combine Python rules and AI decisions).
- Run your first AI backtest: requires Python 3.10+, the example uses Yahoo daily prices and an OpenAI model (model calls incur costs). Save the strategy as my_ai_strategy.py, create the agent in initialize(), and call it on each iteration in on_trading_iteration().
- Connect AI assistants: via BotSpot MCP, Claude, ChatGPT, Codex, Cursor, VS Code, or other MCP-compatible assistants can help write and test LumiBot strategies. Connecting is free; hosted usage depends on the plan.
- Backtest a traditional rule-based strategy: for example, buy 10 shares of AAPL on the first iteration and hold, using Yahoo historical prices, with no AI calls.
- Hybrid strategies: use Python to control rules and agents for research or decisions; for example, a moving-average entry trigger performs a read-only risk review, Python checks the structured answer, determines position size, and submits the order, with the reviewer setting allow_trading=False.
- Fundamental screening: free for each strategyTimely fundamental data filed with the SEC is available without an API key; metrics that cannot be calculated are None, and get_metrics(...)["reasons"] explains why.
- Simulated trading: after a successful backtest, keep the strategy class and replace MyStrategy.backtest(...) with a broker runner, such as Alpaca paper trading. When preparing for live trading, use the same strategy class and intentionally switch the broker account/configuration.
Use cases:
- Build and backtest AI-driven trading strategies.
- Combine Python rules with AI decisions for trading.
- Conduct simulated or live trading across multiple asset classes and brokers.
- Use free SEC fundamental data for strategy screening.
- Let AI coding assistants assist with strategy development via MCP.
Limitations and considerations:
- Requires Python 3.10+.
- AI model calls may incur costs.
- Backtesting requires internet access (e.g., when using Yahoo data).
- The software is for educational and informational purposes only and does not constitute financial advice; algorithmic trading carries a significant risk of loss, including the possibility of losing more than the initial investment; software errors may cause rapid financial loss; past backtest performance does not guarantee future results.
- LumiBot and BotSpot are not registered brokers or financial advisors.
- Users are responsible for complying with applicable laws and regulations.
- Some provider links or promotional codes (including ThetaData) may support continued LumiBot development.
- The license is GNU General Public License v3.0.
Documentation and resources: full documentation is at lumibot.lumiwealth.com; the hosted cloud service is BotSpot.trade; MCP is BotSpot for AI coding agents. The community includes Reddit and Discord.