Registry / devops / lumibot

lumibot

JSON →
library4.5.47pypypiunverified

Lumibot is an algorithmic trading framework for Python 3.10+ that allows you to write strategies once and run them for backtesting or live trading across stocks, options, crypto, futures, and forex. It supports multiple brokers (e.g., Alpaca, Interactive Brokers, Tradier) and data sources. Current version is 4.5.47, with active development.

pip install lumibot
INSTALL
IMPORT
SIG · LUMIBOT
L
lumibot
devopspythonv4.5.47
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Lumibot
from lumibot.lumibot import Lumibot
from lumibot import Lumibot
Top-level import changed; Lumibot class moved to submodule.
Backtesting
from lumibot.backtesting import Backtesting
from lumibot import Backtesting
Backtesting class requires explicit submodule import.
AlpacaBacktesting, AlpacaLive
from lumibot.brokers import AlpacaBacktesting, AlpacaLive
from lumibot.brokers.alpaca import AlpacaBacktesting, AlpacaLive
Previous path changed; now directly under brokers.
TradingStrategy
from lumibot.strategies import TradingStrategy
from lumibot import TradingStrategy
Strategy base class moved to strategies submodule.

Minimal Lumibot backtest. Runs a simple strategy for SPY in 2020.

import os from datetime import datetime from lumibot.strategies import TradingStrategy from lumibot.backtesting import Backtesting class MyStrategy(TradingStrategy): def on_trading_iteration(self): if self.first_iteration: print(f"Starting backtest with cash: {self.cash}") # Backtest parameters params = { "symbols": ["SPY"], "quantity": 10, "side": "buy", } backtest_start = datetime(2020, 1, 1) backtest_end = datetime(2020, 12, 31) strategy = MyStrategy(name="test", budget=100000, parameters=params) backtest = Backtesting(strategy, backtest_start, backtest_end) results = backtest.run() print(results)
Debug
Known issues
breakingLumibot 4.x changed import paths: brokers and strategies moved to submodules. Old imports like `from lumibot import Lumibot` will raise ImportError.
fix
Use correct imports: `from lumibot.lumibot import Lumibot`, `from lumibot.brokers import AlpacaBacktesting`, `from lumibot.strategies import TradingStrategy`.
affects: >=4.0.0
breakingBacktesting and Live classes no longer accept `broker` as first argument; now strategy is first.
fix
Instantiate with `Backtesting(strategy, backtest_start, backtest_end)` instead of `Backtesting(broker, strategy, ...)`.
affects: >=4.0.0
deprecatedUsing `from lumibot import *` is deprecated; prefer explicit imports to avoid namespace pollution and missing submodules.
fix
Use explicit imports like `from lumibot.strategies import TradingStrategy`.
affects: >=3.0.0
gotchaLive trading requires environment variables for API keys (e.g., ALPACA_API_KEY, ALPACA_API_SECRET). Missing keys cause cryptic SSL/connection errors.
fix
Set environment variables before running live trading: `export ALPACA_API_KEY=...`
affects: all
gotchaWhen using Interactive Brokers, lumibot requires TWS or IB Gateway to be running and configured with API port 7496 for paper or 7497 for live.
fix
Start TWS/IB Gateway and ensure API settings allow connections from localhost.
affects: all
Upgrade
Version history
4.5.47latest on PyPI · released Jun 5, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
OpenAI (training)
1
Resources
lumibot — pip install lumibot · libregistry