TradingAgents plays with AI quantitative research

Provide a multi-agent large language model framework to simulate the role division of “real trading institutions” in financial trading/stock analysis scenarios (e.g., fundamental analysts, sentiment analysts, technical analysts, traders, risk control teams, etc.) – this continues the core concept of the original TradingAgents.
Chinese Enhancements (for Chinese users): Support for Chinese interface, localized documentation, support for A-shares, Hong Kong stocks, and US stocks, integration of multiple LLM providers (may include large Chinese models), support for one-click deployment of Docker, etc.
Teaching/Research Positioning: The project clearly states that it is “for learning and research purposes only and does not provide live trading instructions”.

If you are interested in AI × finance × Multi-Agent , then TradingAgents-CN is a project worth running for yourself. It is rewritten from the international open source project TradingAgents and adds a large number of Chinese enhancements: Chinese interface, friendly to A-shares, supports domestic and foreign models, and is easier to deploy.
It doesn’t make “real predictions,” but it’s great for research, strategy experiments, and observing how LLMs reasoning in financial analysis

What is TradingAgents-CN?

In a word:

TradingAgents-CN is a multi-agent-based large language model financial research framework that allows you to simulate how an “AI investment institution” analyzes the market, generates opinions, and makes strategic judgments.

The project has multiple roles built in, like this:

  • Fundamental analyst
  • Technical analyst
  • News sentiment analyst
  • Strategist
  • Trade Execution/Risk Control Agent
  • Manager Agent

Each character is an LLM that talks to each other, argues with each other, and finally outputs a strategy suggestion (for research, not real trading).

Quick Facts of Table of Contents Structure (5 seconds to understand the project)

Before you run it, you need to know what the project will look like.

TradingAgents-CN/
├── backend/ # FastAPI 后端(核心逻辑、代理、数据处理)
├── frontend/ # Vue3 前端(可视化交互界面)
├── docs/ # 文档与配置说明
├── docker/ # Docker 部署文件
├── configs/ # 模型、自定义 agent 配置
└── examples/ # 示例策略与测试脚本

The core is: multi-agent scheduling + LLM inference + financial data analysis.

0. Environmental preparation

You will need:

  • Python 3.9+
  • Node 18+
  • Docker (optional but easiest)
  • An LLM API Key (OpenAI / DeepSeek / Moonshot / Qwen / Gemini are all available)

1. One-click deployment (recommended: Docker)

The least tossing method is:

git clone https://github.com/hsliuping/TradingAgents-CN.git
cd TradingAgents-CN
docker compose up -d

Docker automatically builds:

  • Backend (FastAPI)
  • Front-end (Vue)
  • Redis + MongoDB (caching and data storage)

After successful startup, access:

http://localhost:8080/

You can see the visual interface.

2. Configure your LLM (Critical Step)

Go to the project directory and find:

configs/model_config.yaml

Fill in:

default_model: "deepseek-chat"

models:
 deepseek-chat:
 provider: "openai"
 api_key: "你的API_KEY"
 base_url: "https://api.deepseek.com"
 model: "deepseek-chat"

If you want to use multiple models as different agents, you can also:

fundamental_analyst: "gpt-4o"
technical_analyst: "deepseek-chat"
news_analyst: "qwen-max"

Multi-model combination is the charm of multi-agents.

3. Run an “AI Trading Team” test

After the backend starts, run the example that comes with it:

cd backend
python run_example.py

You will see something like:

[基本面分析师]:公司 Q3 业绩……
[技术分析师]:MACD 出现双金叉……
[新闻情绪]:市场对其事件偏向乐观……
[策略师]:综合三方分析……
[风控]:该仓位风险可控……
[最终建议]:多头/观望/减仓

This is the complete multi-agent collaborative decision chain.

4. Use the front-end interface (the most comfortable way)

Browser access:

http://localhost:8080/

Features include:

  • Enter the ticker symbol
  • Select the analysis period
  • Review the analysis ideas for each agent
  • Download the full analyst report
  • Modify Agent Configuration (Personality, Style, Preferences)

The front-end experience is similar to an “AI investment research terminal”, which is very intuitive.

5. Customize your AI investment team

You can customize:

✔ Number of agents

✔ Which model is used for each agent

✔ “Character setting” (personality, preferences) for each agent

✔ The order of the conversation chain

✔ The format of the strategy output

For example, modification:

configs/agents/fundamental_analyst.yaml

You can make it a “particularly cautious value investor”:

persona: >
 你的任务是作为一个极度谨慎的价值派分析师。
 你不相信股价短期波动,偏好稳健、现金流良好……

 This is AI Agent Engineering.

6. Do your own research project (3 steps)

For example, you want to study “Is ChatGPT stable as a technical analyst?”

Steps:

(1) Write a stock pool:

examples/stocks.txt

(2) Write a task script:

from trading_agents import run_task

for code in ["AAPL", "TSLA", "NVDA"]:
 result = run_task(code, strategy="multi_agent")
 print(result)

(3) Run multiple times, record the analysis process, and compare the consistency of the agent.

You can create your own LLM financial research report.

Advantages of TradingAgents-CN (Why It’s Worth Playing)

  • Multi-agent collaboration instead of a single model
  • Chinese Perfection (Interface, Data, Documentation)
  • Support for domestic models (DeepSeek/Qwen/Moonshot)
  • It is suitable for teaching, research, and course projects
  • Visualization results are friendly

It is friendly to students, researchers, and self-learners.

Minimum Run Summary (30-second version)

  1. git clone
  2. docker compose up -d
  3. Fill in the API Key
  4. Browser access 8080
  5. Experience multi-agent trading decisions

It’s that simple.

Github:https://github.com/hsliuping/TradingAgents-CN
Tubing:

Scroll to Top