--- id: lumibot version: "4.5.83" license: MIT license_treatment: permissive maintenance: active --- # lumibot — Python framework for algorithmic trading: backtesting and live deployment for stocks, options, crypto, futures, and forex. Same code for backtest and live trading. License: permissive · Maintenance: active · Downloads: 106.4K/mo ## What it is and what it does Lumibot is a framework that lets you write a single Python strategy class and run it in three modes: backtest against historical data, paper trade through a broker's simulation, or execute live orders—without rewriting your logic. It abstracts away broker APIs (Alpaca, Interactive Brokers, Tradier, Schwab, and others) and data sources (Yahoo Finance, Polygon, Alpha Vantage, Quandl) so you focus on strategy rules, position sizing, and risk controls. The framework also includes a built-in AI agent runtime where you can define multiple agents with different roles—researcher, bull, bear, trader—that reason through market data, filings, indicators, and macro context before submitting orders. You can mix deterministic Python logic with AI reasoning, or use either approach alone. Backtests produce inspectable artifacts (orders, fills, equity curves), and the same strategy code transitions directly to paper or live trading once you swap the broker configuration. Use it for: - Backtest a multi-asset strategy (stocks, options, crypto, futures) against historical data to validate logic before risking capital. - Paper-trade a strategy through Alpaca or another broker to test execution and slippage in real market conditions without live money. - Deploy a deterministic trading bot that runs on a schedule, checking technical indicators and submitting orders through a live broker connection. - Build an AI trading team where multiple agents debate market evidence and a trader agent decides whether to execute, all within the same Lumibot loop. - Transition a backtest-validated strategy to live trading by changing only the broker configuration, keeping strategy code identical. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Lumibot is a Python framework for building, backtesting, and running algorithmic trading strategies and AI agents across stocks, options, crypto, futures, and forex using a single codebase that works identically in backtest and live trading. Yes, if you are building algorithmic trading strategies or AI trading agents. Lumibot is actively maintained, permissively licensed, and solves the core problem of code reuse across backtest and live trading. The 50 runtime dependencies are substantial but reflect the breadth of brokers and data sources it supports; install friction is low. No known vulnerabilities. Start with backtest and paper trading to validate your logic before going live. ## Install pip install lumibot uv add lumibot poetry add lumibot ## Installing lumibot Before you install: Installation is low-friction; the package ships as a wheel and is actively maintained with a recent release. The 50 runtime dependencies span data providers (yfinance, polygon-api-client, alpha_vantage), brokers (alpaca-py, ibapi), analysis tools (pandas, numpy, scipy, quantstats-lumi), and scheduling (apscheduler), which is typical for a multi-asset trading platform but adds complexity to your environment. License in practice: MIT license is permissive; you can use, modify, and distribute Lumibot freely in commercial and private projects without restriction, though you must retain the license notice. Quickstart: pip install lumibot from datetime import datetime from lumibot.strategies import Strategy from lumibot.backtesting import YahooDataBacktesting class MyStrategy(Strategy): def on_trading_iteration(self): if self.first_iteration: order = self.create_order("AAPL", 10, "buy") self.submit_order(order) MyStrategy.backtest( YahooDataBacktesting, datetime(2023, 1, 1), datetime(2024, 1, 1), ) Requires Python 3.10 or later. Broker paper/live trading requires valid API credentials (e.g., Alpaca key/secret) set as environment variables. Verify before relying: - Whether the 50 runtime dependencies are all required for basic backtest use or if many are optional broker/data-provider integrations. - Performance characteristics and scalability limits for large strategy universes or high-frequency backtests. - Whether AI agent functionality requires external LLM API keys and what the associated costs are. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 106.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags algorithmic trading framework python, backtest trading strategies, live trading bot, multi-asset trading platform, ai trading agents, paper trading simulator, quantitative trading library, trading-bot, backtesting, multi-asset [View on SkillFed](https://skillfed.io/packages/lumibot) · [View on PyPI](https://pypi.org/project/lumibot/)