How charliedream1/ai_quant_trade works
Main Components
• Data Ingestion & Processing: “egs_data” (submodules such as wind, tushare, baostock, etc.) plus the “quant_brain/data_io” components. These connect to external data sources (e.g., Wind, Tushare, JoinQuant) and serve as the data feeds.
• Core Algorithm & Quantitative Modules: “quant_brain” as the heart of the system with submodules for backtesting, risk indicators, portfolio management, and trading control.
• Trading Strategies / Modules:
• “egs_trade” contains both paper_trade (simulated real-time trading), “rl” for reinforcement learning strategies, and “vanilla” for traditional rule-based strategies.
• “egs_alpha” houses the factor libraries and automated alpha/factor mining components.
• Advanced Analysis Modules:
• “egs_fin_nlp” for text analysis and sentiment detection.
• “egs_llm” for large model-based financial analysis and strategy.
• Auxiliary & Deployment Tools:
• “egs_aide” for auxiliary trading tools (“看盘神器”) – supporting real-time market monitoring.
• “runtime” for deployment-related setup (covering CPU/GPU environments, live deployment scripts).
• “tools” for utility functions (date/time, file I/O, logging, plotting, etc.).
• “unit_test” for testing components.
Relationships and Interactions
• Data flows from external financial data providers (Wind, Tushare, etc.) into the Data Ingestion modules (“egs_data” and quant_brain/data_io).
• Processed market data then feeds into both the core algorithm library (“quant_brain”) and various trading strategy modules (egs_trade, egs_alpha).
• The strategy modules might further interact with advanced analysis modules: for example, outputs from “egs_fin_nlp” or “egs_llm” (sentiment or large model analyses) are incorporated into decision-making for the strategies.
• There is a feedback loop from backtesting and simulation (under “quant_brain/back_test” and “egs_trade/paper_trade”) to strategy refinement.
• Deployment via “runtime” connects the developed strategies and algorithms to a live or simulated trading environment.
• “tools” support operations (configuration management, logging, visualization) across the entire system.
• Documentation and training resources (“ai_notes” and “docs”) support user onboarding and knowledge transfer.
Architectural Patterns & Design Principles
• Modular Design: Each high-level folder encapsulates a distinct domain (data, strategy, analysis, deployment), making it easier to maintain and extend.
• Separation of Concerns: Data ingestion, algorithmic execution, strategy backtesting, and auxiliary tooling are kept separate.
• Integration via Core Library: “quant_brain” acts as a bridge between data inputs and strategy executions.
• Flexibility and Extensibility: With submodules for various strategies (RL, traditional, deep learning, etc.) and external resource integration, the design leverages plug-in points for future enhancements.
Incorporate Relevant Technologies
• Python (the predominant language for all modules, as indicated by requirements.txt, flake8, pylint configuration, etc.).
• Financial data APIs (Wind, Baostock, Tushare, etc.).
• Machine Learning / Reinforcement Learning libraries (likely frameworks such as Stable-Baselines3 or custom RL recipes in “egs_trade/rl”).
• Large Language Model (LLM) frameworks and deep learning libraries (possibly PyTorch or TensorFlow in the “egs_llm” modules).
• Supporting tools for configuration, logging, plotting, etc. (in “tools”).
• Review the README’s architecture outline (especially the “目录” and explained folder organization) to verify that all major paths are covered.