TradingAgents-astock: a TradingAgents fork that rebuilds the analyst team for A-shares
A股多Agent投研框架 — 适配A股数据源(龙虎榜/游资/解禁等),7位分析师基于A股规则的辩论决策,基于TradingAgents深度改造,适配大A。A-share multi-agent investment research framework — 7 AI analysts, bull/bear debate, risk assessment。
At a glance
- What is it?
- The upstream TradingAgents framework was built around Yahoo Finance and US market rules. This fork swaps in free mainland data sources and adds three analyst roles that only make sense on the Shanghai and Shenzhen exchanges. Here is what it actually changes, and where it stops.
- Who is it for?
- Adopt it if you research mainland-listed names and want the TradingAgents debate structure with A-share inputs, particularly the policy, hot-money and lockup roles that the upstream project does not have. Do not adopt it if you need US coverage, a production execution path, or a system that is accountable for its output; the README states plainly that it is for research and teaching and gives no investment advice.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 5 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The A-share gap that upstream TradingAgents leaves open
TradingAgents, from TauricResearch, is a multi-agent research framework where several LLM analysts produce reports, two researchers argue bull and bear, and a portfolio manager issues a rating. The README of this fork is blunt about the mismatch: the original is designed for US equities, pulls data from Yahoo Finance or Alpha Vantage, and its analysts have no notion of A-share institutions. The debate and the decision are oriented entirely toward the US market.
The fork's stated goal is to land that same debate architecture on the Shanghai and Shenzhen exchanges through three layers of change rather than translation. The data layer moves to mootdx, Eastmoney, Sina, Tencent, 10jqka, Cailianshe and Baidu. The analyst roster grows from four to seven. The trading rules become T+1, price limits, minimum lot sizes, ST handling and trading sessions. Output reports are in Chinese while internal debate stays in English, a choice the README attributes to reasoning quality. The benchmark for alpha comparison changes from SPY to CSI 300.
Who is this for? Someone who already knows the A-share market and wants an LLM pipeline that at least reads the right inputs. If you do not know what a dragon-tiger list is, the extra roles will produce text you cannot evaluate.
Seven analysts, three of them A-share only
The four inherited roles are market, social sentiment, news and fundamentals, each with its own tool set: get_stock_data and get_indicators for the market analyst, get_news for sentiment, get_news plus get_global_news and get_insider_transactions for news, and the four statement tools for fundamentals.
The three additions are the interesting part. A policy analyst covers regulatory and industrial policy and window guidance, using get_news and get_global_news; the README justifies it by calling the A-share market policy-driven, where policy shifts move sectors directly. A hot-money tracker follows the dragon-tiger list, large-order flow and main capital movement through get_stock_data, get_news and get_insider_transactions, on the argument that short-term pricing is set by these players. A lockup monitor watches share unlock schedules, major-holder reductions and equity pledges via get_insider_transactions, get_news and get_fundamentals, treating unlocks as a supply shock specific to this market.
All seven reports flow into the bull versus bear debate, then a research manager synthesizes an investment plan, a trader produces a plan under A-share constraints, three risk debaters argue aggressive against conservative against neutral, and a portfolio manager issues the final rating. Two LLM tiers are used: quick_think_llm for analysts, researchers, the trader and risk debaters, and deep_think_llm for the research manager and portfolio manager. That split is a cost decision as much as a quality one, and it is the part most users will tune first.
Free data sources and the Eastmoney throttle
Every source listed is free and requires no API key. mootdx speaks the Tongdaxin TCP protocol on port 7709 and supplies OHLCV bars, financial snapshots and F10 text. Tencent at qt.gtimg.cn returns PE, PB, market cap and turnover in real time. Eastmoney's datacenter and push2 endpoints supply the dragon-tiger list, unlock schedules, sector quotes and per-stock information. Sina covers historical bars and the three financial statements, 10jqka provides consensus EPS, Cailianshe supplies global financial flashes, and Baidu's finance endpoint classifies concept sectors and capital flow. The README explicitly says the project avoids Tushare, Alpha Vantage and Yahoo Finance.
The routing rule is worth reading twice. Anything obtainable from mootdx or Tencent goes through them, because the Tongdaxin TCP feed does not block by IP. Eastmoney is reserved for data only it has, and all Eastmoney requests pass through an internal throttle called _em_get(). That function serializes requests with a default interval of at least one second plus random jitter of 0.1 to 0.5 seconds, and reuses a keep-alive session. The README states the risk-control thresholds observed on Eastmoney: more than five requests per second, ten or more concurrent, or two hundred in a minute triggers a temporary IP block. For batch runs it suggests setting EM_MIN_INTERVAL to 1.5 or 2. Only Eastmoney is throttled; the other sources are unaffected.
This is the most concrete engineering in the repository, and also the clearest constraint. A batch of analyses is now rate-limited by design, and the throttle is documented as a response to a real block, not a precaution.
Installing it and running a first analysis
The README asks for Python 3.10 or newer. Clone the repository, install in editable mode, and you are done; the README says no Docker is required and that the project has zero external service dependencies.
git clone https://github.com/simonlin1212/tradingagents-astock.git
cd tradingagents-astock
pip install -e .If you want Gemini models, the project deliberately ships no [google] extra, so you install the pieces by hand. If you want some or all nodes to run against a personal Claude Pro or Max subscription instead of per-token API billing, install the agentsdk extra.
pip install --no-deps "langchain-google-genai>=4.0.0"
pip install "google-genai>=1.53.0" "httpx>=0.28.1"
pip install -e ".[agentsdk]"Next, create a .env file in the project root and pick a provider. The README lists MiniMax as the recommended option for direct mainland access, alongside DeepSeek, Zhipu GLM, Qwen and OpenAI. Whichever you choose, expect 30 to 50 LLM calls per analysis run, which is the number the README gives for budgeting.
MINIMAX_API_KEY=sk-xxx
DEEPSEEK_API_KEY=sk-xxx
ZHIPU_API_KEY=xxx
DASHSCOPE_API_KEY=sk-xxxAfter that you have two entry points. The CLI is the tradingagents command. The web interface is a Streamlit app, and the README notes that the most recent release, v0.5.17, made the Web UI remember your LLM configuration.
streamlit run web/app.pyFor Docker, the compose file defines a CLI service you run with docker compose run --rm tradingagents and a web service you start with docker compose up web, which serves on port 8501. Use the tradingagents-web entrypoint rather than streamlit run web/app.py inside the container: the compose file carries a comment explaining that the entrypoint resolves app.py by absolute path, while the streamlit command depends on the working directory and fails with File does not exist: web/app.py when the directory is wrong. There is also an ollama profile with an LLM_PROVIDER=ollama variant for local models.
Where it breaks: permissions, fonts and a silent absent extra
The Dockerfile documents two failures that are easy to hit and annoying to diagnose. The first is a permission error. A named volume mounted over a directory that does not exist in the image is created as root:root, and the container runs as appuser, so writes to the cache fail with Errno 13 Permission denied on /home/appuser/.tradingagents/cache. The fix in the image is to pre-create the cache, logs and memory directories before the volume mounts. If you build your own image from this project, keep that step.
The second is PDF export. The slim base image ships no CJK font, so the font lookup returns None and Chinese reports cannot be rendered. The Dockerfile installs fonts-wqy-microhei and fonts-noto-cjk for exactly this reason. If you strip packages to shrink the image, you lose Chinese PDF output.
The third is a dependency trap rather than a bug. There is no [google] extra by design. The pyproject comment explains that langchain-google-genai requires google-genai, and the dependency chain conflicts with mootdx's httpx constraint, so the extra was removed. The README tells you to install those packages manually. A user who assumes extras behave normally will get an environment where Gemini simply is not available.
Beyond packaging, the honest limitation is epistemic. Seven analysts producing Chinese reports and a portfolio manager issuing a rating is a research artifact. The README states the project is an engineering implementation and research reproduction of the TradingAgents paper, aimed at research and teaching, and that it constitutes no investment advice and provides no investment service. Nothing in the repository is a backtest of the decisions; backtrader is a dependency, but the repository does not describe a walk-forward evaluation of the agent output.
How it differs from TradingAgents-CN and from running upstream directly
The obvious alternative for a Chinese-speaking user is TradingAgents-CN, which appears in the search data around this project. Both are forks of the same upstream, so the difference is in what each one chose to change. This fork's stated changes are concentrated in three places: free direct-connect data sources with no API key or credit wall, three analyst roles built around A-share institutions, and explicit A-share trading constraints in the trader stage. The README's comparison table against upstream lists exactly those rows and marks upstream as lacking each one.
A second alternative is to keep upstream TradingAgents and write your own data adapters. That is a legitimate path if you already have a data vendor and only want the debate graph. What you would have to rebuild is the analyst layer, because the policy, hot-money and lockup roles are not configuration in upstream; they are new agents with their own tool bindings. You would also need to reimplement the T+1 and price-limit constraints at the trader stage, and the Eastmoney throttle if you use that source.
The third alternative is not to use an LLM pipeline at all for the data-collection half. If what you actually want is the dragon-tiger list, unlock schedules and capital flow, those are plain HTTP endpoints, and a small script against Eastmoney's datacenter API would be faster and cheaper than 30 to 50 model calls per name. The multi-agent structure earns its cost when you want the argument, not the table.
Editorial conclusion
Adopt it if you research mainland-listed names and want the TradingAgents debate structure with A-share inputs, particularly the policy, hot-money and lockup roles that the upstream project does not have. Do not adopt it if you need US coverage, a production execution path, or a system that is accountable for its output; the README states plainly that it is for research and teaching and gives no investment advice. Before relying on anything it prints, verify two things yourself: that the mootdx TCP 7709 connection and the Eastmoney endpoints return data in your network, and that the LLM provider you configure is actually being called, since the README notes each analysis run costs 30 to 50 LLM calls.
Frequently asked questions
What is the TradingAgents multi-agent LLM financial trading framework?
It is the framework described in arXiv paper 2412.20138, in which several LLM analysts write reports, two researchers debate bull and bear cases, and a portfolio manager issues a rating. This repository is an engineering implementation and research reproduction of that framework, specialized for A-shares.
Can AI really do stock trading for me?
This project does not claim to. Its README states it is aimed at research and teaching, constitutes no investment advice, and provides no investment service. It produces ratings and reasoning, not orders.
Which AI agent is best for trading stocks?
The repository does not rank agents, so there is no defensible answer here. What it does document is a specific division of labour: seven analysts with distinct tool sets, a bull versus bear debate, a trader constrained by A-share rules, and a three-way risk debate feeding a final portfolio decision.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/simonlin1212-tradingagents-astock)