能力标签
Lumibot智能交易机器人
🛠
AI工具

Lumibot智能交易机器人

基于 Python · 开源 AI 工具,GitHub 社区精选
英文名:lumibot
⭐ 1.6k Stars 🍴 303 Forks 💻 Python 📄 GPL-3.0 🏷 AI 8.2分
8.2AI 综合评分
交易机器人算法交易AI代理回测框架量化交易
✦ AI Skill Hub 推荐

AI Skill Hub 强烈推荐:Lumibot智能交易机器人 是一款优质的AI工具。已获得 1.6k 颗 GitHub Star,AI 综合评分 8.2 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。

📚 深度解析

Lumibot智能交易机器人 是一款基于 Python 的开源工具,在 GitHub 上收获 2k+ Star,是交易机器人、算法交易、AI代理、回测框架领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
Lumibot智能交易机器人 依赖 Python 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Python 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 Lumibot智能交易机器人 的版本更新,及时通知重要功能变化。

📋 工具概览

Lumibot智能交易机器人 是一款基于 Python 开发的开源工具,专注于 交易机器人、算法交易、AI代理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 1.6k
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
正常维护,社区驱动
开源协议
GPL-3.0
AI 综合评分
8.2 分
工具类型
AI工具
Forks
303

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

Lumibot智能交易机器人 是一款基于 Python 开发的开源工具,专注于 交易机器人、算法交易、AI代理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一: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('安装成功')"
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 命令行使用
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"
📑 README 深度解析 真实文档 完整度 49/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

CI Status Coverage PyPI Python License: MIT

What You Can Build

  • Deterministic strategies: normal Python logic, indicators, if statements, scheduled rules, position sizing, and risk controls.
  • AI-agent strategies: one or more agents that reason through evidence, call tools, write memory, and optionally place orders.
  • Backtests: replay historical data and simulated orders with artifacts you can inspect.
  • Paper or live trading: reuse the same strategy code with real broker state and real order routing.

Start with the open-source docs, then deploy when you are ready: Lumibot documentation · Try a sample Lumibot strategy on BotSpot

Deploy Live

Quick Start

Example: Research, Bull, Bear, and Trader Agents

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:

  1. Research Agent: builds the evidence pack from market data, filings, fundamentals, news, macro data, and indicators.
  2. Bull Agent: turns that evidence into the strongest long thesis.
  3. Bear Agent: challenges the thesis, looks for risk, and argues for avoiding, delaying, or reducing the trade.
  4. Trader / Portfolio Manager Agent: checks cash, positions, open orders, and risk limits, then decides whether to trade.

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.

See this AI trading team running live on BotSpot

More AI Trading Team Examples

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.

  1. Citadel sector pods AI trading team: inspired by the pod-style structure associated with Ken Griffin's Citadel: sector specialists pitch their best ideas, a risk manager challenges crowding and drawdown risk, and a portfolio manager rotates into the strongest sector ETF. Watch it live on BotSpot. Source: ai_trading_team_citadel_sector_pods.py.
  2. Warren Buffett value AI trading team: uses AI agents like a patient value-investing desk: one agent digs into business quality and annual reports, one demands valuation discipline, and the portfolio manager only buys the best long-term compounder. Watch it live on BotSpot. Source: ai_trading_team_warren_buffett_value.py.
  3. Ray Dalio idea meritocracy AI trading team: turns Bridgewater-style thoughtful disagreement into a macro ETF workflow, with growth, inflation, liquidity, and disagreement agents arguing before the trader acts. Watch it live on BotSpot. Source: ai_trading_team_ray_dalio_idea_meritocracy.py.
  4. Bill Ackman concentrated AI trading team: inspired by Pershing Square-style concentrated investing: find one great business, make the activist bull case, attack it like a short seller, then let the portfolio manager take a focused position if the thesis survives. Watch it live on BotSpot. Source: ai_trading_team_bill_ackman_concentrated.py.
  5. Bull/bear leveraged ETF AI trading team: a fast, aggressive demo where bull and bear agents debate leveraged long and inverse ETFs before the trader rotates into one high-conviction ETF. Watch it live on BotSpot. Source: ai_trading_team_bull_bear_leveraged_etf.py.
  6. Bull/bear large-cap stocks AI trading team: the same debate structure applied to familiar large-cap stocks, which makes it easier to inspect each agent's reasoning before using more volatile instruments. Watch it live on BotSpot. Source: ai_trading_team_bull_bear_large_cap_stocks.py.

Example Strategies

Lumibot includes 25+ example strategies covering stocks, options, crypto, futures, forex, and Polymarket prediction contracts:

```bash

Or explore all examples

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.

Option A: BotSpot (managed cloud)

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>

Option B: Self-hosted (full control)

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()

Remote Cache Configuration

Lumibot can mirror its local parquet caches to AWS S3. See docs/remote_cache.md for configuration.

Compared with AI trading agent projects

ProjectMain angleAI agents / teamsBacktest agent decisionsPaper/live broker pathDeterministic Python strategiesHosted 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**
TradingAgentsMulti-agent LLM trading research frameworkYes, with a specific research/debate structureResearch/demo orientedNot the main focusLimitedNo
ai-hedge-fundEducational AI hedge fund with named investor-style agentsYes, with investor-style personasDemo/backtest orientedNot the main focusLimitedNo
OpenAliceOne-person Wall Street agent conceptYes, end-to-end agent conceptEmerging/experimentalLocal/self-run focusLimitedNo
QuantDingerSelf-hosted AI quant operating systemYesYesCrypto, IBKR, MT5, AlpacaYesSelf-hosted
Vibe-TradingPersonal trading agentYesYesAgent trading platform focusLimitedPlatform-specific
AI-TraderAgent-native trading platformYesPlatform focusPlatform focusLimitedPlatform-specific
OpenBBFinancial data platform for analysts, quants, and AI agentsTooling for agentsNot a strategy backtesterNo broker execution frameworkNoOpenBB workspace/platform
QlibAI-oriented quant research platformResearch/ML agentsQuant research backtestsLimited live focusResearch pipelinesNo

See the docs comparison pages for more detail: Lumibot vs TradingAgents, Lumibot vs ai-hedge-fund, Lumibot vs OpenAlice, and Lumibot vs QuantDinger.

Compared with backtesting libraries

FeatureLumibotBacktraderFreqtradeZiplineBacktesting.pyJessevectorbtNautilusTraderHummingbot
**Same code: backtest + live**YesYesYes (crypto)NoNoYes (paid)NoYesYes (crypto)
**Stocks**YesYesNoYesYesNoYesYesNo
**Options****Yes**NoNoNoNoNoNoLimitedNo
**Crypto**YesLimitedYesNoYesYesYesYesYes
**Prediction markets**Polymarket trading and backtestingNoNoNoNoNoNoNoLimited/no
**Futures**YesLimitedCrypto onlyPartialYesCrypto onlyYesYesPerpetuals/crypto venues
**Forex**YesOutdatedNoNoYesNoYesYesNo
**AI agent runtime**Built-inNoFreqAI (ML)NoNoML pipelineNoNoScripts/controllers
**Broker execution**Alpaca, IBKR, Tradier, Schwab, Tradovate, TopstepX (via ProjectX), Bitunix, Polymarket, selected CCXTIB only (outdated)Crypto exchangesNoneNoneCrypto exchangesNoExchange adaptersCrypto exchanges
**Hosted deployment path**BotSpotNoNoNoNoPaid cloudNoNoHummingbot Foundation/enterprise ecosystem
**License**MITGPL-3.0GPL-3.0Apache-2.0AGPL-3.0MITApache-2.0LGPL-3.0Apache-2.0

Switching from Backtrader? See our migration guide for a side-by-side comparison with code examples.

Data source comparison

Data SourceOHLCVSplit AdjustedDividendsDividend Adjusted Returns
YahooYesYesYesYes
AlpacaYesYesNoNo
PolygonYesYesNoNo
TradierYesYesNoNo
PolymarketYesN/AN/AN/A
Pandas*YesYesYesYes

*Pandas loads CSV files in Yahoo dataframe format, which can contain dividends.

🎯 aiskill88 AI 点评 A 级 2026-05-20

专业的AI交易框架,集成度高、文档完善、社区活跃。适合想用AI构建量化交易系统的开发者,但需具备金融知识。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • Python 依赖冲突:建议用 venv / uv 隔离环境
部署方案
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
lumibot 中文教程lumibot 安装报错怎么办lumibot MCP 配置lumibot Agent 工作流lumibot 与同类工具对比lumibot 最佳实践lumibot 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
  • Python 依赖冲突:建议用 venv / uv 隔离环境

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +GPL-3.0 协议,可免费商用
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • 安装和初始配置可能需要一定技术基础
  • 功能完整性通常不如成熟商业产品
  • 技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

⚠️ GPL 3.0 — 强 Copyleft,衍生作品须开源,含专利保护条款,不可闭源使用。

🔗 相关工具推荐

📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

主要支持Alpaca、Interactive Brokers等,可扩展集成其他经纪商。
💡 AI Skill Hub 点评

总体来看,Lumibot智能交易机器人 是一款质量优秀的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。

📚 深入学习 Lumibot智能交易机器人
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 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
🔗 原始来源
🐙 GitHub 仓库  https://github.com/Lumiwealth/lumibot 🌐 官方网站  https://lumibot.lumiwealth.com

收录时间:2026-05-19 · 更新时间:2026-05-30 · License:GPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →