TradingAgents/docs
liuping 38ca293fe2 feat: upgrade Chinese market integration - replace TongDaXin with Tushare API
重大升级:专业Tushare API替代通达信

##  核心改进

###  数据源升级
-  完全移除通达信(TongDaXin/TDX)依赖
-  集成专业Tushare API
-  更稳定可靠的数据获取
-  官方API文档和技术支持

###  智能市场处理
-  自动识别中美股票代码格式
-  智能数据源路由选择
-  中国股票(6位数字)  Tushare API
-  美国股票(字母代码)  Yahoo Finance

###  分析师工具优化
-  Market Analyst智能工具选择
-  Fundamentals Analyst中国股票支持
-  专门的中国股票分析提示词
-  保持美股分析逻辑完全不变

###  系统架构增强
-  完整的错误处理和多层回退机制
-  智能缓存系统(MongoDB + Redis)
-  交互式CLI市场选择和验证
-  完整的双语文档体系

##  主要技术变更

### 新增核心模块
- tradingagents/dataflows/tushare_utils.py (Tushare API完整集成)
- tradingagents/dataflows/interface.py (智能数据源选择引擎)

### 优化现有模块
- tradingagents/agents/analysts/ (智能分析师工具选择)
- cli/utils.py (数据源配置: tongdaxin  tushare)
- tradingagents/dataflows/ (完整的通达信代码清理)

### 配置和文档
- .env.example (完整的API配置指南)
- docs/ (彻底清理通达信引用,统一Tushare术语)
- requirements.txt (依赖优化: pytdx  tushare)

##  全面测试验证

###  功能测试
- 6/6 Tushare API集成测试通过
- 智能数据源选择算法验证
- 分析师工具正确路由确认
- CLI交互功能完整性测试

###  兼容性测试
- 美股分析功能完全保持不变
- 现有配置文件向后兼容
- API接口保持一致性
- 无破坏性变更确认

###  生产就绪验证
- 错误处理和回退机制测试
- 数据库缓存系统集成测试
- 多用户并发访问测试
- 长时间稳定性运行测试

##  升级效果对比

### 之前版本 (通达信集成)
- 依赖不稳定的通达信API
- 单一数据源,容错性有限
- 文档和技术支持不足
- 数据质量和及时性问题

### 现在版本 (Tushare专业集成)
- 企业级专业金融数据API
- 智能多数据源架构
- 完整官方文档和技术支持
- 金融级数据质量和实时性

##  商业价值

这次升级将TradingAgents从基础的中国市场支持
提升为专业级的全球金融分析平台:

-  为中国用户提供专业A股数据支持
-  保持美股市场的卓越分析能力
-  统一的全球股票分析体验
-  企业级稳定性和可靠性

Ready for production deployment!
2025-07-11 01:37:42 +08:00
..
en-US feat: upgrade Chinese market integration - replace TongDaXin with Tushare API 2025-07-11 01:37:42 +08:00
zh-CN feat: upgrade Chinese market integration - replace TongDaXin with Tushare API 2025-07-11 01:37:42 +08:00
README.md feat: upgrade Chinese market integration - replace TongDaXin with Tushare API 2025-07-11 01:37:42 +08:00

README.md

TradingAgents Documentation

📚 Documentation Structure

This documentation is organized into language-specific directories to serve different user communities:

🇺🇸 English Documentation (en-US/)

Status: Included in version control

Contains comprehensive guides for English-speaking users:

  • Configuration Guide (configuration_guide.md) - Detailed instructions for modifying system configurations and agent prompts
  • Quick Reference (quick_reference.md) - Quick lookup card for common modifications and file locations
  • Prompt Templates (prompt_templates.md) - Ready-to-use prompt templates for various agent roles

🇨🇳 Chinese Documentation (zh-CN/)

Status: Included in version control

Contains comprehensive guides in Chinese for Chinese-speaking users:

  • 主文档 (README.md) - 中文版系统概览和快速开始
  • 配置指南 (configuration_guide.md) - 详细的配置修改和新功能设置指南
  • 架构指南 (architecture_guide.md) - 系统架构和技术实现详解
  • 快速开始指南 (quick_start_guide.md) - 5分钟快速设置和使用教程
  • 快速参考 (quick_reference.md) - 新手友好的快速查找卡片
  • 提示词模板库 (prompt_templates.md) - 可直接使用的提示词模板

🎯 Quick Start

For English Users

Navigate to en-US/ directory for:

  • System configuration instructions
  • Prompt customization guides
  • Template libraries
  • Troubleshooting tips

For Chinese Users

Navigate to zh-CN/ directory for:

  • 系统配置说明
  • 中国A股市场功能
  • 百炼(DashScope)集成指南
  • 数据库配置说明
  • 提示词定制指南
  • 架构技术文档
  • 故障排除技巧

📖 Available Guides

Guide English Chinese Description
Main Documentation 📖 View 📖 查看 System overview and quick start
Configuration Guide 📖 View 📖 查看 Complete guide for modifying configurations and new features
Architecture Guide 🏗️ View 🏗️ 查看 System architecture and technical implementation
Quick Start Guide 🚀 View 🚀 查看 5-minute setup and usage tutorial
Quick Reference 📋 View 📋 查看 Quick lookup for common modifications
Prompt Templates 🎯 View 🎯 查看 Ready-to-use prompt templates

🔧 Key Topics Covered

Configuration Management

  • LLM provider settings (DashScope, OpenAI, Google, Anthropic)
    • DashScope (Alibaba Cloud): Full support for Qwen model series Recommended for Chinese users
    • Current Setup: DashScope as primary option with intelligent fallback
  • Market selection and data sources
    • US Stock Market: Yahoo Finance integration
    • China A-Share Market: Tushare API integration New Feature
  • Database and caching systems
    • MongoDB: Persistent data storage
    • Redis: High-performance caching
    • Intelligent Cache: Automatic fallback mechanisms
  • Debate and discussion parameters
  • API configuration and limits

Agent Customization

  • Market Analyst prompts
  • Fundamentals Analyst prompts
  • News and Social Media Analyst prompts
  • Bull/Bear Researcher prompts
  • Trader decision prompts
  • Reflection system prompts

Advanced Features

  • Multi-market support: US stocks and China A-shares
  • Database integration: MongoDB and Redis for enterprise deployment
  • Intelligent caching: Adaptive cache management with fallback
  • Multi-LLM support: DashScope, OpenAI, Google, Anthropic
  • Tushare integration: Real-time A-share data access
  • Risk management templates
  • Performance optimization
  • Custom prompt creation
  • Environment-specific configurations

🚀 Getting Started

  1. Choose Your Language: Select the appropriate documentation directory
  2. Start with Quick Reference: Get familiar with key file locations
  3. Read Configuration Guide: Understand the system architecture
  4. Use Prompt Templates: Copy and customize templates for your needs
  5. Test Changes: Always test modifications in a safe environment

🛠️ Development Workflow

For Contributors

  1. English Documentation:

    • Modify files in en-US/ directory
    • Commit changes to version control
    • These will be available to all users
  2. Chinese Documentation:

    • Modify files in zh-CN/ directory
    • Keep changes local (not committed)
    • Use for local development and testing

Version Control Policy

  • Include: en-US/ directory and all English documentation
  • Include: zh-CN/ directory and all Chinese documentation
  • Include: This README file for navigation
  • 🎯 Rationale: Both language versions provide value to the global community

📝 Contributing

When contributing to documentation:

  1. Update English docs for features that should be shared with the international community
  2. Update Chinese docs for features that benefit Chinese-speaking users
  3. Maintain consistency between language versions when possible
  4. Test all examples before documenting them
  5. Consider localization - some features may be more relevant to specific regions
  • Project Repository: Main TradingAgents codebase
  • Configuration Files: tradingagents/default_config.py, main.py
  • Agent Files: tradingagents/agents/ directory
  • Test Files: tests/ directory (local only)

📞 Support

For questions about:

  • Configuration: See Configuration Guide
  • Prompts: See Prompt Templates
  • Quick Help: See Quick Reference
  • Issues: Submit to project repository

💡 Note: This documentation structure allows for both community sharing (English) and local customization (Chinese) while maintaining clean version control.