AI Skill Hub 强烈推荐:Lumibot智能交易机器人 是一款优质的AI工具。已获得 1.6k 颗 GitHub Star,AI 综合评分 8.2 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
Lumibot智能交易机器人 是一款基于 Python 开发的开源工具,专注于 交易机器人、算法交易、AI代理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
Lumibot智能交易机器人 是一款基于 Python 开发的开源工具,专注于 交易机器人、算法交易、AI代理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install lumibot
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install lumibot
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/Lumiwealth/lumibot
cd lumibot
pip install -e .
# 验证安装
python -c "import lumibot; print('安装成功')"
# 命令行使用
lumibot --help
# 基本用法
lumibot input_file -o output_file
# Python 代码中调用
import lumibot
# 示例
result = lumibot.process("input")
print(result)
# lumibot 配置文件示例(config.yml) app: name: "lumibot" debug: false log_level: "INFO" # 运行时指定配置文件 lumibot --config config.yml # 或通过环境变量配置 export LUMIBOT_API_KEY="your-key" export LUMIBOT_OUTPUT_DIR="./output"
Start with the open-source docs, then deploy when you are ready: Lumibot documentation · Try a sample Lumibot strategy on BotSpot
Here is one example pattern: a researcher gathers evidence, bull and bear agents debate the trade, and a trader agent decides what to buy or sell.
<p align="center"> <img src="docs/assets/readme/lumibot_investment_committee_architecture.png" alt="Lumibot AI trading team workflow" width="100%"> </p>
In this pattern, each agent has a job:
The copy-paste example below implements that exact team. It uses Gemini Flash Lite because it is fast and inexpensive for experiments.
To run it with a broker in paper mode, set your AI and Alpaca credentials and run the file:
export GEMINI_API_KEY='your-key-here'
export ALPACA_API_KEY='your-alpaca-key'
export ALPACA_API_SECRET='your-alpaca-secret'
export ALPACA_IS_PAPER=true
python ai_trading_team_bull_bear_leveraged_etf.py
To backtest the same strategy instead, change IS_BACKTESTING = False to IS_BACKTESTING = True in the runner:
export GEMINI_API_KEY='your-key-here'
python ai_trading_team_bull_bear_leveraged_etf.py
Save this as ai_trading_team_bull_bear_leveraged_etf.py. If an AI key is missing or invalid, Lumibot stops and prints a clear provider key error with a link to create a key.
import os
from datetime import datetime
from lumibot.strategies.strategy import Strategy
class AITradingTeamBullBearLeveragedETFStrategy(Strategy):
parameters = {
"universe": ["TQQQ", "SQQQ", "UPRO", "SPXU", "UDOW", "SDOW", "TNA", "TZA", "TECL", "TECS", "SOXL", "SOXS", "WEBL", "WEBS", "FAS", "FAZ", "LABU", "LABD", "ERX", "ERY", "GUSH", "DRIP", "DRN", "DRV", "TMF", "TMV", "NUGT", "DUST"],
}
def initialize(self):
self.sleeptime = "1D"
model = os.environ.get("AI_TRADING_TEAM_MODEL", "gemini-3.1-flash-lite")
# The first three agents are read-only. They can reason, but cannot trade.
self.agents.create(
name="researcher",
model=model,
allow_trading=False,
system_prompt="Rank the ETFs by upside. Be direct.",
)
self.agents.create(
name="bull",
model=model,
allow_trading=False,
system_prompt="Argue for the strongest money-making trade.",
)
self.agents.create(
name="bear",
model=model,
allow_trading=False,
system_prompt="Point out the biggest risk, briefly.",
)
# Only this final agent can submit orders through Lumibot.
self.agents.create(
name="trader",
model=model,
allow_trading=True,
system_prompt="Buy one ETF from the universe aggressively. Use nearly all cash.",
)
def on_trading_iteration(self):
# Each trading day, pass the same market context through the team.
context = {
"date": self.get_datetime().date().isoformat(),
"universe": self.parameters["universe"],
}
research = self.agents["researcher"].run(
task_prompt="Pick the strongest ETF.",
context=context,
)
bull = self.agents["bull"].run(
task_prompt="Make the bull case.",
context={**context, "research": research.summary},
)
bear = self.agents["bear"].run(
task_prompt="Make the bear case.",
context={**context, "research": research.summary, "bull": bull.summary},
)
self.agents["trader"].run(
task_prompt="Sell anything that is not the pick, then buy the best ETF with nearly all available cash.",
context={**context, "research": research.summary, "bull": bull.summary, "bear": bear.summary},
)
if __name__ == "__main__":
IS_BACKTESTING = False
if IS_BACKTESTING:
from lumibot.backtesting import YahooDataBacktesting
AITradingTeamBullBearLeveragedETFStrategy.backtest(
YahooDataBacktesting,
datetime(2026, 4, 7),
datetime(2026, 5, 22),
)
else:
from lumibot.brokers import Alpaca
from lumibot.traders import Trader
ALPACA_CONFIG = {
"API_KEY": os.environ["ALPACA_API_KEY"],
"API_SECRET": os.environ["ALPACA_API_SECRET"],
"PAPER": os.environ.get("ALPACA_IS_PAPER", "true").lower() != "false",
}
broker = Alpaca(ALPACA_CONFIG)
strategy = AITradingTeamBullBearLeveragedETFStrategy(broker=broker)
trader = Trader()
trader.add_strategy(strategy)
trader.run_all()
Example backtest artifact from this sample strategy:
<p align="center"> <img src="docs/assets/ai-trading-team-example/ai-trading-team-tearsheet-rob-crop-2026-05-24.png" alt="AI trading team backtest tear sheet compared to SPY" width="100%"> </p>
Backtests are not expected future performance. The point is that the full AI trading team runs inside Lumibot's normal broker and backtest loops, so the decisions, orders, and artifacts are inspectable before you connect real money.
These examples show different ways to organize an AI trading team. Each page explains the inspiration, the agent flow, how to run it with a broker in paper mode, and how to backtest it.
ai_trading_team_citadel_sector_pods.py.ai_trading_team_warren_buffett_value.py.ai_trading_team_ray_dalio_idea_meritocracy.py.ai_trading_team_bill_ackman_concentrated.py.ai_trading_team_bull_bear_leveraged_etf.py.ai_trading_team_bull_bear_large_cap_stocks.py.Lumibot includes 25+ example strategies covering stocks, options, crypto, futures, forex, and Polymarket prediction contracts:
```bash
ls lumibot/example_strategies/ ```
Browse all examples: example_strategies/
Polymarket example: polymarket_prediction_contract.py
External example repo: stock_example_algo shows a minimal strategy repository you can run yourself or adapt inside BotSpot.
BotSpot is the managed path for taking a Lumibot strategy from idea to backtest to paper or live trading. It handles the expensive and fragile parts around the strategy: hosted data setup for supported backtests, parallel backtest runs, broker connections, scheduling, logs, alerts, monitoring, audit history, and kill-switch controls.
This is especially useful when your strategy only needs to run daily or periodically. You get the same Lumibot code path without paying for always-on infrastructure, maintaining a scheduler, hand-wiring broker secrets, or building your own log and alerting stack.
<p align="center"> <img src="docs/assets/readme/lumibot_backtest_live_parity.png" alt="One Lumibot strategy can run in backtests and live broker accounts" width="100%"> </p>
<p align="center"> <a href="https://botspot.trade/sales?showLogin=1&utm_source=github&utm_medium=readme&utm_campaign=lumibot&utm_content=deploy_live_button&sample=lumibot_readme_deploy"> <img src="docs/assets/readme/cta_deploy_on_botspot.png" alt="Try deploying a sample Lumibot strategy on BotSpot" width="520"> </a> </p>
Run Lumibot on your own machine with any supported broker:
from lumibot.brokers import Alpaca
from lumibot.traders import Trader
ALPACA_CONFIG = {
"API_KEY": "your-key",
"API_SECRET": "your-secret",
"PAPER": True,
}
broker = Alpaca(ALPACA_CONFIG)
strategy = MyStrategy(broker=broker)
trader = Trader()
trader.add_strategy(strategy)
trader.run_all()
Lumibot can mirror its local parquet caches to AWS S3. See docs/remote_cache.md for configuration.
| Project | Main angle | AI agents / teams | Backtest agent decisions | Paper/live broker path | Deterministic Python strategies | Hosted data/deploy/monitoring |
|---|---|---|---|---|---|---|
| **Lumibot + BotSpot** | Python strategies, flexible AI trading teams, hybrid guardrails, backtests, brokers, hosted deployment | **Flexible teams, debates, specialist desks, and deterministic gates** | **Replayable decisions, orders, traces, artifacts, charts, logs** | **Yes: Alpaca, IBKR, Tradier, Schwab, Tradovate, ProjectX, Bitunix, Polymarket, selected CCXT** | **Yes** | **Hosted data, parallel backtests, deployment, monitoring, MCP, alerts, kill switches** |
| TradingAgents | Multi-agent LLM trading research framework | Yes, with a specific research/debate structure | Research/demo oriented | Not the main focus | Limited | No |
| ai-hedge-fund | Educational AI hedge fund with named investor-style agents | Yes, with investor-style personas | Demo/backtest oriented | Not the main focus | Limited | No |
| OpenAlice | One-person Wall Street agent concept | Yes, end-to-end agent concept | Emerging/experimental | Local/self-run focus | Limited | No |
| QuantDinger | Self-hosted AI quant operating system | Yes | Yes | Crypto, IBKR, MT5, Alpaca | Yes | Self-hosted |
| Vibe-Trading | Personal trading agent | Yes | Yes | Agent trading platform focus | Limited | Platform-specific |
| AI-Trader | Agent-native trading platform | Yes | Platform focus | Platform focus | Limited | Platform-specific |
| OpenBB | Financial data platform for analysts, quants, and AI agents | Tooling for agents | Not a strategy backtester | No broker execution framework | No | OpenBB workspace/platform |
| Qlib | AI-oriented quant research platform | Research/ML agents | Quant research backtests | Limited live focus | Research pipelines | No |
See the docs comparison pages for more detail: Lumibot vs TradingAgents, Lumibot vs ai-hedge-fund, Lumibot vs OpenAlice, and Lumibot vs QuantDinger.
| Feature | Lumibot | Backtrader | Freqtrade | Zipline | Backtesting.py | Jesse | vectorbt | NautilusTrader | Hummingbot |
|---|---|---|---|---|---|---|---|---|---|
| **Same code: backtest + live** | Yes | Yes | Yes (crypto) | No | No | Yes (paid) | No | Yes | Yes (crypto) |
| **Stocks** | Yes | Yes | No | Yes | Yes | No | Yes | Yes | No |
| **Options** | **Yes** | No | No | No | No | No | No | Limited | No |
| **Crypto** | Yes | Limited | Yes | No | Yes | Yes | Yes | Yes | Yes |
| **Prediction markets** | Polymarket trading and backtesting | No | No | No | No | No | No | No | Limited/no |
| **Futures** | Yes | Limited | Crypto only | Partial | Yes | Crypto only | Yes | Yes | Perpetuals/crypto venues |
| **Forex** | Yes | Outdated | No | No | Yes | No | Yes | Yes | No |
| **AI agent runtime** | Built-in | No | FreqAI (ML) | No | No | ML pipeline | No | No | Scripts/controllers |
| **Broker execution** | Alpaca, IBKR, Tradier, Schwab, Tradovate, TopstepX (via ProjectX), Bitunix, Polymarket, selected CCXT | IB only (outdated) | Crypto exchanges | None | None | Crypto exchanges | No | Exchange adapters | Crypto exchanges |
| **Hosted deployment path** | BotSpot | No | No | No | No | Paid cloud | No | No | Hummingbot Foundation/enterprise ecosystem |
| **License** | MIT | GPL-3.0 | GPL-3.0 | Apache-2.0 | AGPL-3.0 | MIT | Apache-2.0 | LGPL-3.0 | Apache-2.0 |
Switching from Backtrader? See our migration guide for a side-by-side comparison with code examples.
| Data Source | OHLCV | Split Adjusted | Dividends | Dividend Adjusted Returns |
|---|---|---|---|---|
| Yahoo | Yes | Yes | Yes | Yes |
| Alpaca | Yes | Yes | No | No |
| Polygon | Yes | Yes | No | No |
| Tradier | Yes | Yes | No | No |
| Polymarket | Yes | N/A | N/A | N/A |
| Pandas* | Yes | Yes | Yes | Yes |
*Pandas loads CSV files in Yahoo dataframe format, which can contain dividends.
专业的AI交易框架,集成度高、文档完善、社区活跃。适合想用AI构建量化交易系统的开发者,但需具备金融知识。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
⚠️ GPL 3.0 — 强 Copyleft,衍生作品须开源,含专利保护条款,不可闭源使用。
总体来看,Lumibot智能交易机器人 是一款质量优秀的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | lumibot |
| 原始描述 | 开源AI工作流:Backtestable AI trading agents and algorithmic trading strategies for stocks, op。⭐1.6k · Python |
| Topics | 交易机器人算法交易AI代理回测框架量化交易 |
| GitHub | https://github.com/Lumiwealth/lumibot |
| License | GPL-3.0 |
| 语言 | Python |
收录时间:2026-05-19 · 更新时间:2026-05-30 · License:GPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。