QTrade/requirements.txt
cuizhan 67b85ab232 Refactor: Implement WebSocket architecture with separated communication and business logic layers
- Implemented WebSocket protocol v1.0 specification with protocol headers, versioning, and batch support
- Renamed qtrade_server.py -> ws_server.py, client_adapter.py -> ws_client.py to reflect WebSocket implementation
- Created pure communication layer (WSClient) with only connect/send/close functionality
- Created business logic layer (BacktestClientAdapter) for protocol construction and signal parsing
- Updated bt_engine.py to use BacktestClientAdapter for strategy communication
- Fixed datetime formatting issues (time.strftime -> datetime.now().strftime for %f support)
- Fixed WebSocket 1000 OK close code logging issue
- Translated all logger output from Chinese to English for better compatibility
- Successfully tested with 242 K-lines data transmission

Architecture changes:
- networks/ layer: Pure WebSocket communication (no business logic)
- backtest/ layer: Business logic (protocol v1.0 message construction)
- Clear separation of concerns between transport and application layers
2025-12-25 16:15:56 +08:00

39 lines
1.1 KiB
Plaintext

# QTrade 项目依赖库
# 安装命令: pip install -r requirements.txt
# 或在conda环境中: conda run -n py311 pip install -r requirements.txt
# ==================== GUI框架 ====================
PyQt6>=6.10.0
# ==================== 数据处理 ====================
pandas>=2.0.0
numpy>=1.24.0
# ==================== 图表绘制 ====================
matplotlib>=3.7.0
mplfinance>=0.12.0
# ==================== 技术指标计算 ====================
# TA-Lib推荐使用conda安装: conda install -c conda-forge ta-lib
# Windows系统pip安装需要预编译whl: https://github.com/cgohlke/talib-build/releases
TA-Lib>=0.4.28
# ==================== 数据库 ====================
pymysql>=1.1.0
sqlalchemy>=2.0.0
# ==================== 数据验证 ====================
pydantic>=2.0.0
# ==================== 配置文件 ====================
pyyaml>=6.0
# ==================== 工具库 ====================
python-dateutil>=2.8.0
pytz>=2023.0
# ==================== 数据源(可选) ====================
xtquant # 迅投QMT数据源
fastapi>=0.95.0 # 用于构建API服务
uvicorn[standard]
websockets>=11.0.0 # 用于WebSocket通信