How simonlin1212/tradingagents-astock works
TradingAgents-Astock is an A-share investment-research framework that turns a stock and date into analyst reports and a final trading decision. The principal workflow runs seven A-share-aware analysts, a bull/bear research debate and plan, an A-share-constrained trader proposal, then a three-way risk debate and portfolio decision. Users can initiate analysis through the CLI or Web UI; the Web UI also supports progress and historical-report viewing. README documents the stages and data-source capabilities; unsampled subsystem wiring is shown only where documented.
Main entry points: setup.py Graph Setup · app.py Web UI · trading_graph.py Trading Graph · research_manager.py Research Manager
Components 21
User Interfaces
- CLI
cli/main.py - Web UI
web/app.py - Web Runner
web/runner.py - Report Viewer
web/components/report_viewer.py - Analysis History
web/history.py
Analysis Workflow
- Trading Graph
tradingagents/graph/trading_graph.py - Graph Setup
tradingagents/graph/setup.py
Research and Debate
- Seven Analysts
tradingagents/agents/analysts - Research Tools
tradingagents/agents/utils - Bull Researcher
tradingagents/agents/researchers/bull_researcher.py - Bear Researcher
tradingagents/agents/researchers/bear_researcher.py - Research Manager
tradingagents/agents/managers/research_manager.py
Trading Decision
- Trader
tradingagents/agents/trader/trader.py - Risk Debaters
tradingagents/agents/risk_mgmt - Portfolio Manager
tradingagents/agents/managers/portfolio_manager.py
Models and Data
- A-Share Dataflows
tradingagents/dataflows - Market Data Sources
- LLM Factory
tradingagents/llm_clients/factory.py - LLM Providers
tradingagents/llm_clients - Model Services
Other components
- Research User
Connections 27
- Research User → CLI: starts analysis
- Research User → Web UI: starts or views
- CLI → Trading Graph: runs analysis
- Web UI → Web Runner: starts analysis
- Web Runner → Trading Graph: runs analysis
- Trading Graph → Graph Setup: builds workflow
- Graph Setup → Seven Analysts: dispatches
- Graph Setup → Bull Researcher: dispatches
- Graph Setup → Bear Researcher: dispatches
- Graph Setup → Research Manager: dispatches
- Graph Setup → Trader: dispatches
- Graph Setup → Risk Debaters: dispatches
- Graph Setup → Portfolio Manager: dispatches
- Seven Analysts → Research Tools: uses tools
- Research Tools → A-Share Dataflows: requests data
- A-Share Dataflows → Market Data Sources: fetches from
- Bull Researcher → Research Manager: debate informs plan
- Bear Researcher → Research Manager: debate informs plan
- Research Manager → Trader: provides plan
- Trader → Risk Debaters: provides proposal
- Risk Debaters → Portfolio Manager: debate informs decision
- Trading Graph → LLM Factory: configures models
- LLM Factory → LLM Providers: creates clients
- LLM Providers → Model Services: calls models
- Web UI → Report Viewer: renders report
- Web UI → Analysis History: loads history
- Analysis History → Report Viewer: supplies report