TradingAgents README

项目的 README,来自 github.com/TauricResearch/TradingAgents。合并为一个 markdown 文件:README.md。

Tauric Research

arXiv X GitHub YouTube Website

TradingAgents #1 Repository of the Day

English | Deutsch | Español | français | 日本語 | 한국어 | Português | Русский | 中文

TradingAgents: Towards Agentic Finance Research

TradingAgents researching a question in the terminal

Quick start

1. Get an API key

2. Install

curl -fsSL https://tauric.ai/tradingagents/install.sh | sh

Or with npm: npm i -g @tauric/tradingagents

3. Run

tradingagents

Start your agentic finance research with Tauric!

Models

Provider Needs
Tauric AI Tauric API key
OpenAI, Anthropic, Google, DeepSeek, OpenRouter their API key
Self-hosted models (vLLM, Ollama) its address and model
AI subscriptions (ChatGPT) tradingagents login chatgpt

With another provider, /login adds a Tauric API key for filings, statements and news. See docs/models.md.

Usage

Type a question and press Enter. Every figure in the answer is marked with its source, and a numbered list of sources follows.

Command Does
/ Open the commands
/model Choose the model and how hard it reasons
/resume Resume an earlier session
/export Save the last answer as a PDF report, or the session as Markdown
/copy Copy the last answer
/help List every command and key

Shift+Tab switches to plan mode, where the agent proposes a research plan first.

Architecture

What TradingAgents can call on: the main agent's tools, its data and compute tools, its agents and its skills

Agents and skills

The main agent plans the research, reads what the question needs with its data tools, and works the numbers with its compute tools. For depth, it briefs specialist agents, each in its own context:

Agent Covers
Equity Research a company's statements, filings, estimates, valuation, ownership and news
Macro Strategy growth, inflation, rates and the yield curve, credit, sectors, cross-asset moves
Quant Research returns, volatility, drawdowns, correlation and beta, technical indicators
Risk Analysis what could make a position lose, and what would show it early

For a known kind of research it follows a skill:

Area Skills
Companies company snapshot, earnings preview and review, filing review, full analysis
Valuation DCF, relative valuation, scenario analysis
Markets macro outlook, market brief, performance comparison, sector review, technical analysis
Risk portfolio review, risk assessment, thesis review

You can add your own agents and skills as Markdown files (docs/usage.md). TradingAgents researches and answers; it does not place trades.

Documentation

To report an issue or open a pull request, see CONTRIBUTING.md; to report a security problem, SECURITY.md.

Citation

@article{xiao2024tradingagents,
  title={TradingAgents: Multi-agents LLM financial trading framework},
  author={Xiao, Yijia and Sun, Edward and Luo, Di and Wang, Wei},
  journal={arXiv preprint arXiv:2412.20138},
  year={2024}
}

License

Apache-2.0. See LICENSE.

TradingAgents (TauricResearch/TradingAgents)

正在搜索数据库…

这是什么?TradingAgents 是一个多智能体 LLM 框架,用来模拟一家交易公司:不同的专业智能体分别分析基本面、市场情绪、新闻和技术面;看多与看空两方研究员对分析结果进行辩论;再由交易员和风险与投资组合经理团队决定是否执行交易。
这是一个可以接入我自己代码的框架,还是一个现成的交易机器人?两者都是。你可以运行交互式 CLI,端到端地分析股票代码;也可以在自己的 Python 代码中导入 tradingagents 模块,调用 TradingAgentsGraph().propagate() 来获取决策结果。
我怎样才能让它跑起来?克隆仓库,创建虚拟环境,用 pip 安装该包及其依赖,然后启动交互式 CLI;也支持使用 Docker 作为替代方式。
使用哪些 LLM 提供商需要我准备 API 密钥?它支持 OpenAI、Google、Anthropic、xAI、DeepSeek、通义千问(Qwen)、智谱 GLM、MiniMax、OpenRouter、Azure OpenAI 和 AWS Bedrock,还支持任何兼容 OpenAI 接口的服务(如 vLLM、LM Studio、llama.cpp);本地运行的 Ollama 模型则完全不需要密钥。
同一只股票跑两次,结果会一样吗?不会。LLM 的采样本身具有随机性,而且实时新闻和社交数据会随时间变化,所以即使是同一只股票、同一日期,结果也会有差异。降低 temperature,或通过 Custom model ID 选项选用非推理类模型,可以减少这种差异。
这是用来真正交易的吗?不是。它仅用于研究目的,明确不构成任何金融、投资或交易建议;获批的订单会发送到模拟交易所,而不是真实的经纪商。
我能分析哪些股票市场和股票代码?Yahoo Finance 覆盖的任何市场都可以,使用带交易所后缀的代码:美国(AAPL)、香港(0700.HK)、东京(7203.T)、伦敦(AZN.L)、印度、加拿大、澳大利亚、中国 A 股,以及 BTC-USD 这类加密货币交易对。
决策日志在多次运行之间会记住什么?它是一个始终开启的日志,位于 ~/.tradingagents/memory/trading_memory.md,记录每只股票过去的决策和实际收益,然后把这些复盘内容注入到下一次运行的 Portfolio Manager 提示词中,让经验教训得以延续。
检查点续跑是做什么用的?这是一个可选功能(需加 --checkpoint 参数),基于 LangGraph,会在每个节点执行后保存状态。因此运行中断或崩溃后,可以从最后一个成功的步骤继续,而不必从头开始。
为什么回测收益不一定与公开发布的数字一致?收益取决于所选模型、temperature、日期范围以及实时数据质量,因此应将该框架视为用于研究多智能体分析的研究脚手架,而不是固定、可复现的策略。
大小
11.2 MB
星标
124.4K
时长
1年
提交 · 90 天