TradingAgents for A-Shares

A multi-agent investment-research framework tailored to China’s A-share market rules and data.

Stars
★ 3.5k
Last updated
3d ago
License
Apache-2.0
Primary language
Python

At a glance

Works with
Universal · cross-platformOpenAI API · Claude APIClaude Code · Claude.ai (Partial support)
You'll need
Python >= 3.10LLM provider credentialsmootdxShell / CLINetwork accessLocal filesystem
Typical use
A financial-AI researcher studying multi-agent debate behavior while incorporating policy, hot-money, and lockup factors specific to A-shares.
Main limitation
A typical analysis uses roughly 30–50 LLM calls and normally requires the user’s own API key and paid provider account, except when using the optional Claude subscription path.

What does this agent do, and when should you use it?

TradingAgents-Astock is an A-share-focused fork and engineering implementation of the TradingAgents paper framework, intended for research and teaching rather than investment services. Its LangGraph workflow combines seven analysts, a bull-versus-bear research debate, trade planning, and a three-party risk debate before a Portfolio Manager returns a rating and rationale. The framework retrieves market, financial, news, and A-share-specific information from sources including mootdx, Tencent Finance, Eastmoney, Sina Finance, Tonghuashun, Cailianpress, and Baidu Stock Connect. It can run as a Python library through TradingAgentsGraph, through an interactive CLI, or through a Streamlit web interface with Markdown and PDF exports. Users provide their own LLM credentials and run it locally; the repository does not host an analysis service or retain results.

A call such as TradingAgentsGraph.propagate("688017", "2026-05-12") runs seven LangGraph analyst roles: market, social, news, fundamentals, policy, hot-money tracking, and lockup monitoring. They generate reports using data tools named get_stock_data, get_indicators, get_news, get_global_news, get_fundamentals, get_balance_sheet, get_cashflow, get_income_statement, and get_insider_transactions. Their reports then flow through Bull Researcher and Bear Researcher debate, Research Manager synthesis, Trader planning, and Aggressive, Conservative, and Neutral risk discussion. The Portfolio Manager produces a direction, rating, and rationale; the framework explicitly does not produce entry prices, stop-loss levels, position sizes, or target prices. The web UI exposes 12-stage progress, report viewing, history, and Markdown/PDF downloads, while the CLI and examples/run_cases.py can write complete reports and summary.json files to disk.

  1. A financial-AI researcher studying multi-agent debate behavior while incorporating policy, hot-money, and lockup factors specific to A-shares.
  2. A Python-capable individual researcher who wants to run a repeatable, multi-stage analysis for one six-digit A-share ticker.
  3. An investment-research instructor who needs separate technical, financial, news, and risk-discussion reports for teaching.
  4. A non-programming user who wants to enter a ticker, date, and lookback period in a local Streamlit interface and inspect the full analysis flow.
  5. A user who needs to batch-run symbols with examples/run_cases.py and save complete_report.md plus summary.json.

How do you install or deploy this agent?

Requires Python >= 3.10, network access, and credentials for at least one supported LLM provider.

git clone https://github.com/simonlin1212/tradingagents-astock.git
cd tradingagents-astock

pip install -e .

Create a .env file in the project root, for example:

MINIMAX_API_KEY=sk-xxx

The documented alternatives include DEEPSEEK_API_KEY, DASHSCOPE_API_KEY, ZHIPU_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, and other provider-specific variables. The optional Claude Agent SDK mode is installed with:

pip install -e ".[agentsdk]"

How do you use this agent?

First Python invocation:

from tradingagents.graph.trading_graph import TradingAgentsGraph
config = {

"llm_provider": "minimax",
"deep_think_llm": "MiniMax-M2.7",
"quick_think_llm": "MiniMax-M2.7-highspeed",
"output_language": "Chinese",
}

ta = TradingAgentsGraph(debug=True, config=config)
final_state, decision = ta.propagate("688017", "2026-05-12")
print(decision)

For the interactive CLI, run tradingagents. For the web UI, run tradingagents-web or streamlit run web/app.py, then open http://localhost:8501.

What are this agent's strengths and limitations?

Pros
  • Its workflow incorporates A-share constraints such as T+1 settlement, price limits, minimum lot sizes, and ST coverage in the trading layer.
  • It adds dedicated policy, hot-money, and lockup analysts for A-share-specific factors including Dragon Tiger List activity, fund flows, shareholder reductions, and restricted-share unlocks.
  • It separates quick_think_llm from deep_think_llm and documents paths for MiniMax, DeepSeek, Qwen, GLM, OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama, and OpenAI-compatible gateways.
  • It offers a Python API, CLI, Streamlit UI, saved history, and Markdown/PDF report export.
Limitations
  • A typical analysis uses roughly 30–50 LLM calls and normally requires the user’s own API key and paid provider account, except when using the optional Claude subscription path.
  • Data collection depends on several public network sources; Eastmoney requests require built-in throttling, and batch use is advised to set EM_MIN_INTERVAL=1.5~2.
  • Some analyst reports can be empty when the selected model has unreliable tool-calling behavior; the documented remedy is a more capable model or a retry.
  • Google Gemini dependencies have a structural httpx installation conflict with mootdx, requiring explicit package installation or a separate virtual environment.
  • The project deliberately omits executable entry prices, stop-losses, position sizing, and target prices, so it is not a complete trade-execution system.

How does this agent compare with similar options?

Compared with upstream TradingAgents, this fork replaces the Yahoo Finance / Alpha Vantage-oriented data path with A-share data sources and expands four analyst roles to seven. It changes the benchmark from SPY to CSI 300 and adds A-share trading constraints. The documentation also presents its direct data retrieval approach as avoiding dependencies on Tushare, Alpha Vantage, and Yahoo Finance.

Key facts side by side with the most closely related agents.

Agent Source review Stars Updated Language Full support on
TradingAgents for A-Shares This agent 52 · Major gaps ★ 3.5k 3d ago Python OpenAI API · Claude API
TradingAgents Financial Research Framework 76 · Good ★ 108k 6d ago Python OpenAI API · Claude API
OpenLens Research Agent 33 · Major gaps ★ 282 14d ago Python OpenAI API
DATAGEN Research Assistant 44 · Major gaps ★ 1.8k 7d ago Python OpenAI API · Claude API

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
52/ 100 5-point scale 2.6 / 5
Trust 8/29
Reliability 8/14
Adaptability 12/18
Convention 11/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust8 / 29 · 1.4/5

Evidence shows: project uses user-provided API keys, no hardcoded credentials; data flow described in README but lacks detailed diagrams or logs; sensitive data handling: API keys via env vars, no mention of encryption; dependency security: dependencies listed in pyproject.toml, no vulnerability scan or lock file; external effects: calls external data sources and LLM APIs, no data usage policy; rollback: no rollback mechanism mentioned; source attribution: README and NOTICE clearly attribute upstream. Deductions: lack of user confirmation, detailed data flow transparency, and rollback.

Reliability8 / 14 · 2.9/5

Evidence shows: README and code structure consistent, config options and roles clear; dependencies listed but no lock file, known httpx conflict; failure messages: detailed troubleshooting in README, error handling in code. Deductions: dependency availability reduced due to conflict and missing lock file.

Adaptability12 / 18 · 3.3/5

Evidence shows: README defines target audience (research/teaching) and scenarios (A-share investment research); capability boundaries clear, explicitly no investment advice or executable prices; trigger precision: detailed config options and role definitions; environment fit: supports multiple LLM providers and deployment methods. Deductions: minor, Docker vs local differences not fully explained.

Convention11 / 18 · 3.1/5

Evidence shows: README well-structured with quick start, config, FAQ; install notes detailed, pip and Docker; naming stable, version clear; examples and FAQ rich; known limitations mentioned; license Apache-2.0 with LICENSE and NOTICE; changelog in CHANGES_FROM_UPSTREAM.md; maintenance responsibility: author info clear, but no maintenance commitment. Deductions: maintenance responsibility not explicitly committed.

Effectiveness9 / 13 · 3.5/5

Evidence shows: output is Chinese report with analyst reports, debate, decision; clear format; marginal value: A-share specific roles (policy, hot money, lockup); cost-benefit: multiple LLM providers, free data sources, but 30-50 LLM calls per analysis. Deductions: none significant.

Verifiability4 / 8 · 2.5/5

Evidence shows: README cites upstream paper and repo, declares changes; cross-source corroboration: multiple data sources, but no accuracy verification; fact-inference separation: README clearly distinguishes facts (data sources) and inferences (analysis reports). Deductions: cross-source corroboration insufficient.

Risks and how to mitigate them
  • Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
  • Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
  • The project depends on multiple external data sources and LLM APIs, but no data usage policy or privacy statement is provided; users must assess data compliance themselves.
  • There is a known httpx dependency conflict; installing Gemini requires manual handling, which may affect dependency availability.
  • No rollback mechanism is provided; recovery may be difficult after upgrades or misconfiguration.
  • The project states it does not provide investment advice, but outputs may be misinterpreted as such; users should use with caution.
Evidence confidence: Low Reviewed Aug 09, 2026 Reviewed revision 0badc3340c70 New commits since this review; the score may not cover them
See the full review method →

FAQ

Does it provide entry prices, stop-losses, or position sizes?
No. Trader and Portfolio Manager output only direction, rating, and rationale; the repository states that entry prices, stop-losses, position sizes, and target prices are not implemented.
Does it cost money to run?
The data sources are described as free direct connections, but a normal analysis requires an LLM API key and roughly 30–50 LLM calls. After installing [agentsdk], some or all nodes can optionally use a locally logged-in Claude CLI and a personal Claude Pro/Max subscription allowance.
Why might an analyst report be missing?
Empty reports are skipped. The documentation identifies unstable model tool-calling as a common cause and recommends choosing a model with stronger tool calling or retrying.
Can it use a self-hosted or third-party OpenAI-compatible gateway?
Yes. Set llm_provider="openai_compatible" along with backend_url, model IDs, and OPENAI_COMPATIBLE_API_KEY or OPENAI_API_KEY.
View on GitHub ↗ Install ↓

Related agents