# TradingAgents-CN | hsliuping | Knowledge Base | Instagit

基于多智能体LLM的中文金融交易框架 - TradingAgents中文增强版

GitHub Stars: 17.3k

Repository: https://github.com/hsliuping/tradingagents-cn

---

## Articles

### [How to Run Unit Tests for Agent Components in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-run-unit-tests-agent-components-tradingagents-cn)

Learn how to run unit tests for agent components in TradingAgents-CN. Execute agent-specific tests with pytest -k "agents" or run the full suite easily.

- Tags: tutorial
- Published: 2026-02-19

### [How the Reflection and Memory System Tracks Trading Mistakes in TradingAgents-CN](/hsliuping/tradingagents-cn/how-reflection-memory-system-track-trading-mistakes-tradingagents-cn)

Discover how TradingAgents-CN uses reflection and memory to track trading mistakes. LLM analysis labels decisions, while vector embeddings store past errors for efficient retrieval.

- Tags: deep-dive
- Published: 2026-02-19

### [How to Configure Risk Management Debate Rounds and Conditional Logic in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-configure-risk-management-debate-rounds-conditional-logic-tradingagents-cn)

Learn to configure risk management debate rounds and conditional logic in TradingAgents-CN. Master workflow routing to the Risk Judge node for enhanced control. Read the guide now.

- Tags: how-to-guide
- Published: 2026-02-19

### [How to Add a New LLM Adapter for a Custom Provider in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-add-new-llm-adapter-custom-provider-tradingagents-cn)

Learn to add a new LLM adapter for a custom provider in TradingAgents-CN. This guide covers Python module creation, LangChain subclassing, and export for seamless integration.

- Tags: how-to-guide
- Published: 2026-02-19

### [How to Configure and Switch Between Different LLM Providers (Google, DeepSeek, DashScope, OpenAI) in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-configure-switch-llm-providers-tradingagents-cn)

Seamlessly configure and switch between Google, DeepSeek, DashScope, and OpenAI LLM providers in TradingAgents-CN. Integrate multiple LLMs with ease for web UI, CLI, and Python API.

- Tags: how-to-guide
- Published: 2026-02-19

### [How to Implement Custom Technical Indicators Using the stockstats Module in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-implement-custom-technical-indicators-stockstats-tradingagents-cn)

Learn to implement custom technical indicators in TradingAgents-CN by extending stockstats. Customize your trading strategies with unique analyses.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Optimize LangGraph Propagation for Large-Scale Batch Analysis in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-optimize-langgraph-propagation-large-scale-batch-analysis-tradingagents-cn)

Learn to optimize LangGraph propagation for large-scale batch analysis at TradingAgents-CN. Maximize efficiency by reusing compiled graphs, using bulk data endpoints, and streaming updates to reduce memory usage.

- Tags: performance
- Published: 2026-02-16

### [How to Export Analysis Reports in Markdown, Word, and PDF Formats from TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-export-analysis-reports-markdown-word-pdf-tradingagents-cn)

Easily export TradingAgents-CN analysis reports in Markdown, Word, and PDF formats. Utilize the ReportExporter class for programmatic APIs and convenient UI buttons for seamless document generation.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Configure the Logging System for Production Deployments of TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-configure-logging-system-production-deployments-tradingagents-cn)

Configure TradingAgents CN logging for production. Enable the production block set environment variables and call init logging for effective monitoring.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Customize Debate Prompts for Bull and Bear Researchers in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-customize-debate-prompts-bull-bear-researchers-tradingagents-cn)

Learn to customize debate prompts for bull and bear researchers in TradingAgents-CN. Edit f-string templates or use YAML for flexible prompt management.

- Tags: how-to-guide
- Published: 2026-02-16

### [How the Adaptive Cache Manager Handles Expired and Stale Data in TradingAgents-CN](/hsliuping/tradingagents-cn/how-adaptive-cache-manager-handle-expired-stale-data-tradingagents-cn)

Discover how the adaptive cache manager in TradingAgents-CN prevents stale data. Learn about TTL validation, backend expiration, and cache cleanup for reliable trading pipelines.

- Tags: internals
- Published: 2026-02-16

### [How to Add a New Stock Market (e.g., Singapore) to TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-add-new-stock-market-data-source-system)

Learn to add a new stock market like Singapore to TradingAgents-CN. Extend the StockMarket enum, update regex, map markets, and implement a data provider. Expand your trading data sources.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Persist Model Selection and API Keys in the Database for TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-persist-model-selection-api-keys-database-tradingagents-cn)

Learn how to persist model selection and API keys in the database for TradingAgents-CN. Discover MongoDB and Streamlit session state integration for robust configuration management.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Troubleshoot Common Data Source Fallback and Timeout Errors in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-troubleshoot-data-source-fallback-timeout-errors-tradingagents-cn)

Troubleshoot TradingAgents-CN data source fallback and timeout errors. Enable debug logging, verify API tokens, adjust timeouts, or use environment variables to fix connectivity.

- Tags: how-to-guide
- Published: 2026-02-16

### [How the China Market Analyst Calculates PE, PB, and Fundamental Metrics in TradingAgents-CN](/hsliuping/tradingagents-cn/how-china-market-analyst-calculate-pe-pb-fundamental-metrics)

Learn how the China Market Analyst calculates PE, PB, and fundamental metrics using real time data Tushare and MongoDB for accurate trading insights.

- Tags: how-to-guide
- Published: 2026-02-16

### [How Real-Time News Streaming Works in TradingAgents-CN: A Technical Deep Dive](/hsliuping/tradingagents-cn/how-real-time-news-streaming-work-news-retriever-tradingagents-cn)

Discover how TradingAgents-CN streams real-time news. Explore data aggregation, normalization, and urgency ranking with the RealtimeNewsAggregator for financial insights.

- Tags: deep-dive
- Published: 2026-02-16

### [How to Set Up Docker Deployment with Redis and MongoDB for TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-set-up-docker-deployment-redis-mongodb-tradingagents-cn)

Quickly deploy TradingAgents-CN using Docker Compose for a full trading system stack including FastAPI, Vue 3, MongoDB, and Redis in under five minutes. Learn how to set up your Docker deployment now.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Use the CLI for Single Stock Analysis with Custom Parameters in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-use-cli-single-stock-analysis-custom-parameters-tradingagents-cn)

Master single stock analysis with TradingAgents-CN's CLI. Customize parameters like date, analyst team, and LLM settings for in-depth reports. Run python -m cli.main analyze to begin.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Integrate Additional Data Sources into the TradingAgents-CN Dataflows System](/hsliuping/tradingagents-cn/how-to-integrate-additional-data-sources-dataflows-system-tradingagents-cn)

Learn to integrate new data sources into TradingAgents-CN. Implement a provider class, register it, and enable via MongoDB for seamless dataflow management.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Debug Analysis Issues Using the Agent State Propagation System in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-debug-analysis-issues-agent-state-propagation-tradingagents-cn)

Debug analysis issues in TradingAgents-CN by enabling debug mode and inspecting performance metrics to pinpoint analyst node failures or timeouts during state propagation.

- Tags: how-to-guide
- Published: 2026-02-16

### [How the Multi-Agent LangGraph Architecture Works in TradingAgents-CN](/hsliuping/tradingagents-cn/how-does-multi-agent-langgraph-architecture-work-in-tradingagents-cn)

Discover how TradingAgents CN uses LangGraph for multi-agent collaboration. Explore analyst nodes, conditional routing, and state management for an efficient trading pipeline.

- Tags: deep-dive
- Published: 2026-02-16

### [How the MongoDB Cache Layer Improves Data Retrieval Performance in TradingAgents-CN](/hsliuping/tradingagents-cn/how-mongodb-cache-layer-improve-data-retrieval-performance-tradingagents-cn)

Discover how the MongoDB cache layer in TradingAgents-CN significantly boosts data retrieval performance. Enjoy sub-millisecond responses and reduced API calls by serving data locally.

- Tags: performance
- Published: 2026-02-16

### [How the TradingAgents-CN Data Source Manager Prioritizes and Falls Back Between Tushare, AKShare, and BaoStock](/hsliuping/tradingagents-cn/how-data-source-manager-prioritize-fallback-tushare-akshare-baostock)

Discover how the TradingAgents-CN DataSourceManager automatically prioritizes AKShare, Tushare, and BaoStock, ensuring seamless fallback for uninterrupted data retrieval.

- Tags: how-to-guide
- Published: 2026-02-16

### [How to Configure and Use the Unified News Tool for Stock Analysis in TradingAgents-CN](/hsliuping/tradingagents-cn/how-to-configure-use-unified-news-tool-stock-analysis-tradingagents-cn)

Learn to configure and use the unified news tool for AI driven stock analysis in TradingAgents-CN. Automatically fetch relevant news for A-share, HK, and US markets.

- Tags: how-to-guide
- Published: 2026-02-16

### [Configuration and Optimization Strategies for the Multi-Layer Caching System in TradingAgents](/hsliuping/tradingagents-cn/what-are-the-configuration-and-optimization-strategies-for-the-multi-layer-caching-system-in-tradingagents)

Discover multi-layer caching strategies for TradingAgents. Learn to configure and optimize file, Redis, and MongoDB backends with TTL policies and robust failover.

- Tags: optimization-guide
- Published: 2026-02-16

### [Technical Indicator Calculations in TradingAgents stockstats.py: Implementation and Architecture](/hsliuping/tradingagents-cn/what-are-the-technical-details-of-the-technical-indicator-calculations-in-tradingagents-stockstats.py)

Explore the technical indicator calculations in TradingAgents stockstats.py. Learn how SMA, MACD, and RSI are computed using price data and extract values for specific trading dates.

- Tags: internals
- Published: 2026-02-16

### [How the Data Source Manager Coordinates Multiple Data Sources for Different Markets in TradingAgents](/hsliuping/tradingagents-cn/how-does-the-data-source-manager-coordinate-multiple-data-sources-for-different-markets-in-tradingagents)

Learn how the TradingAgents data source manager coordinates multiple data sources. Discover dynamic selection, prioritization, and fallback strategies for diverse markets with centralized abstraction.

- Tags: how-to-guide
- Published: 2026-02-16

### [How Different Agent Types Communicate and Coordinate in the TradingAgents Multi-Agent System](/hsliuping/tradingagents-cn/how-do-different-agent-types-communicate-and-coordinate-within-the-multi-agent-system-in-tradingagents)

Explore how TradingAgents-CN agents communicate and coordinate using a state-driven graph, message passing, and conditional routing for dynamic execution in multi-agent trading.

- Tags: internals
- Published: 2026-02-16

