TradingAgents for A-Shares
A multi-agent investment-research framework tailored to China’s A-share market rules and data.
- Source repo
- simonlin1212/TradingAgents-astock
- Stars
- ★ 3.5k
- Last updated
- 3d ago
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 52/100 · Major gaps
At a glance
- Works with
- Universal · cross-platformOpenAI API · Claude APIClaude Code · Claude.ai (Partial support)
- You'll need
- 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.
- Source review
- 52/100 · Major gaps 2 safety controls not found
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.
- A financial-AI researcher studying multi-agent debate behavior while incorporating policy, hot-money, and lockup factors specific to A-shares.
- A Python-capable individual researcher who wants to run a repeatable, multi-stage analysis for one six-digit A-share ticker.
- An investment-research instructor who needs separate technical, financial, news, and risk-discussion reports for teaching.
- 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.
- 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-astockpip install -e .
Create a .env file in the project root, for example:
MINIMAX_API_KEY=sk-xxxThe 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 TradingAgentsGraphconfig = {"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?
- 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.
- 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?
Why each dimension lost points
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.
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.
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.
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.
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.
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.
- 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.