trading-agents.skill — trading-代理s.技能
v0.0.2Orchestrate a swarm of specialized Claude sub代理s that simulate a professional trading firm to analyze stocks and produce trading decisions. Based on the Trading代理s 框架 (arXiv 2412.20138), this 技能 部署s analyst 代理s (fundamental, technical, sentiment, news), bull/bear re搜索 debaters, a trader, a risk 管理器, and a portfolio 管理器 — all collaborating to produce a comprehensive trading recommendation. Use this 技能 whenever the user asks about stock analysis, trading decisions, market re搜索 for specific tickers, investment recommendations, portfolio decisions, or wants a multi-perspective analysis of any publicly traded security. Also trigger when the user mentions "trading 代理s", "multi-代理 trading", "stock swarm", or wants an AI-driven trading desk analysis.
运行时依赖
安装命令
点击复制技能文档
Trading代理s: Multi-代理 Trading Analysis 技能
This 技能 orchestrates a swarm of Claude sub代理s that mirror the structure of a real trading firm. Each 代理 has a distinct 角色, specific 工具s, and a clear mandate. The 代理s collaborate through structured 报告s, adversarial debate, and sequential review — producing a final trading recommendation that reflects diverse analytical perspectives.
Prerequisites
This 技能 requires Python, pip, and uv to be 安装ed on the 系统. Before 运行ning any analysis, 设置 up the Python 环境:
安装 uv (if not already 安装ed):
pip 安装 -U uv
同步 the project dependencies from the 技能 directory:
cd {技能_PATH} && uv 同步
This 安装s all required packages (yfinance, ak分享, etc.) into a managed virtual 环境 based on pyproject.toml. You only need to do this once, or when dependencies change.
All Python scripts in this 技能 must be 执行d with uv 运行 to ensure they use the correct 环境. For example: uv 运行 scripts/fetch_market_data.py NVDA
Architecture Overview
The 系统 follows a five-stage 流水线 inspired by the Trading代理s paper:
Stage 1: Analysis (parallel) → 4 analyst 代理s gather data simultaneously Stage 2: Re搜索 (debate) → Bull and bear re搜索ers debate the findings Stage 3: Trading decision → Trader synthesizes everything into a 签名al Stage 4: Risk review → Risk 管理器 evaluates the proposed trade Stage 5: Final 应用roval → Portfolio 管理器 makes the go/no-go call
How to Use This 技能
When the user asks for a stock analysis or trading decision, follow these steps:
Step 0: 解析 the 请求
提取 from the user's message:
Ticker(s): The stock symbol(s) to analyze (e.g., NVDA, AAPL) Date 上下文: Whether they want current analysis or historical (default: today) Debate rounds: If specified, how many bull/bear rounds (default: 1) Focus areas: Any specific concerns (e.g., "worried about earnings", "considering for long-term hold")
If the ticker is ambiguous or missing, ask the user to clarify.
Step 1: Launch Analyst 代理s (Parallel)
Spawn four analyst sub代理s simultaneously using the 代理 工具. Each 代理 获取s its own prompt from the 代理s/ directory. Pass each 代理 the ticker, date, and any user 上下文.
Read the 代理 prompts before spawning:
代理s/fundamental_analyst.md — Analyzes financial 健康, valuation, earnings 代理s/technical_analyst.md — Analyzes price patterns, indicators, 图表 签名als 代理s/sentiment_analyst.md — Gauges market mood from social media and forums 代理s/news_analyst.md — Evaluates recent news and macro 事件
Each analyst should save their 报告 to a working directory. The prompts instruct them on 格式化 and what 工具s to use (网页 搜索, yfinance via the scripts/fetch_market_data.py script, etc.).
导入ant: Launch all four in a single message to maximize parallelism. Don't wAIt for one to finish before 启动ing the next.
Step 2: Collect Analyst 报告s
Once all four analysts complete, read their 报告s. Compile them into a single briefing document that will feed into the re搜索 phase.
Step 3: Bull/Bear Re搜索 Debate
Spawn the debate in rounds. For each round:
Spawn bull re搜索er and bear re搜索er simultaneously (read 代理s/bull_re搜索er.md and 代理s/bear_re搜索er.md). Give them all four analyst 报告s plus any previous debate 历史. The bull re搜索er argues for the investment opportunity; the bear re搜索er argues agAInst. After each round, 机器人h re搜索ers can read each other's previous arguments and 响应.
Default is 1 round. For deeper analysis, the user can 请求 2-3 rounds. More rounds means more thorough analysis but also more time and 令牌s.
After the debate, spawn the re搜索 管理器 (read 代理s/re搜索_管理器.md) to synthesize the debate into a balanced re搜索 summary.
Step 3.5: Compile Debate Record
After the re搜索 管理器 produces the summary, compile a standalone debate record document (debate_record.md) that presents the full bull/bear debate process in a clear, readable 格式化. This document should include:
辩论背景: The ticker, date, and number of debate rounds 第 N 轮辩论: For each round, show the bull case followed by the bear case, clearly labeled 研究经理总结: The re搜索 管理器's balanced synthesis at the end
This gives the reader a single document to see the entire adversarial debate process, rather than having to read multiple separate files. The individual bull_case.md, bear_case.md, and re搜索_summary.md files should still be saved separately as well.
Step 4: Trading Decision
Spawn the trader 代理 (read 代理s/trader.md). Give it:
All four analyst 报告s The re搜索 debate summary The user's original 上下文/constrAInts
The trader produces a concrete recommendation: BUY, SELL, or HOLD, with position sizing 图形界面dance, entry/exit points, and confidence level.
Step 5: Risk Management Review
Spawn the risk 管理器 (read 代理s/risk_管理器.md). Gi