Commit Graph

3 Commits

Author SHA1 Message Date
085427959c feat: Phase 4-7 - Core Service, Strategy Engine, QMT Adapter, Tests
Phase 4: Core Service (port 8010)
- Pairing management (symbol-strategy pairs)
- Order service with Redis pub/sub
- Position and balance tracking

Phase 5: Strategy Engine (port 8030)
- BaseStrategy abstract class
- Strategy registry and executor
- Built-in strategies: Grid, MA Cross, Dual MA
- Signal manager with Redis integration

Phase 6: QMT Adapter (port 8040)
- XtQuant SDK wrapper with simulation mode
- Order executor listening to Redis channels
- Quote pusher and account syncer

Phase 7: Testing & Documentation
- Pytest fixtures for all services
- Unit tests for models and strategies
- Windows startup scripts
2025-12-09 00:36:27 +08:00
e04da0f51d fix: 修复 Pylance 类型检查错误
修复内容:
- 移除未使用的导入 (database.py, logger.py, main.py, market.py, trading.py, kline.py, kline_service.py, data_player.py)
- 修复字典键重复问题 (trading.py, account.py, backtest.py)
- 修复 SQL 执行类型错误,使用 text() 包装 (health.py, kline.py)
- 修复 Redis 客户端类型推断问题 (redis_client.py)
  - 添加 pyright 忽略指令和 type: ignore
  - 添加 ping(), smembers(), scan_iter() 等方法
  - 修复 lpop/rpop/sismember 返回类型
- 修复 data_player.py 中的 params 类型注解
2025-12-08 23:46:08 +08:00
be4ee5d41c refactor: 微服务架构重构 - 阶段1核心模块完成
- 新增架构设计文档 (ARCHITECTURE.md)
- 新增构建方案文档 (BUILD_PLAN.md)
- 实现核心模块 (src/core/):
  - config.py: Pydantic Settings + YAML 配置管理
  - redis_client.py: 异步 Redis 客户端
  - database.py: SQLAlchemy 2.0 异步数据库
  - logger.py: 统一日志模块
  - models/: 数据模型 (market, order, position, symbol_strategy)
- 新增服务启动入口 (src/main.py)
- 清理旧代码,准备微服务架构
2025-12-08 17:53:35 +08:00