skillfed

lumibot

Python framework for algorithmic trading: backtesting and live deployment for stocks, options, crypto, futures, and forex. Same code for backtest and live trading.

lumibot v4.5.83 106.4K downloads/30d#12,654 on PyPI1,924
Permissive license MIT Active released

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 on this page — 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

lumibot on PyPI

pip

pip install lumibot

uv

uv add lumibot

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 50 — polygon-api-client, alpaca-py, alpha_vantage, ibapi, yfinance, matplotlib, quandl, numpy, pandas, polars, pandas_market_calendars, pandas-ta-classic, plotly, sqlalchemy, bcrypt, pytest, yappi, scipy, quantstats-lumi, python-dotenv, ccxt, termcolor, jsonpickle, apscheduler, appdirs, pyarrow, tqdm, lumiwealth-tradier, py-clob-client-v2, pytz
Maintenance actively maintained — 9 days since the last release
Last repo commit
First released
Downloads 106,381/month — #12,654 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: lumibot-4.5.83-py3-none-any.whl

Keywords: algorithmic-trading, backtesting, trading-bot, live-trading, stocks, options, crypto, cryptocurrency, futures, forex, quantitative-finance, alpaca, interactive-brokers, tradier, polymarket, schwab, trading-strategies, paper-trading, ai-trading, multi-asset, event-driven

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Office/Business :: FinancialTopic :: Office/Business :: Financial :: InvestmentTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Software Development :: Libraries :: Python Modules

Tags

algorithmic trading framework pythonbacktest trading strategieslive trading botmulti-asset trading platformai trading agentspaper trading simulatorquantitative trading library
trading-botbacktestingmulti-asset

More Python Modules packages

Further reading