1bc3c99482
refactor: 简化服务架构 - 统一HTTP服务模式
...
- 新增 BaseApp 基类,统一 FastAPI 应用生命周期管理
- 移除 Gateway 服务,各服务直接对外提供 HTTP 接口
- 重命名 qmt_adapter 为 qmt_service
- 移除各服务独立的 health.py,统一由 BaseApp 提供
- 新增 scripts/init_db.py 数据库初始化脚本
- 新增 scripts/download_kline.py K线数据下载示例
- 删除 console 模块(暂不使用)
- 更新 .gitignore 忽略 caches/ 和 learning_materials/
2025-12-10 00:15:19 +08:00
e3f34cd57c
refactor: ORM模型重构 + 服务管理器 + QMT数据下载器
...
主要变更:
- 重构 models: 统一使用 SQLAlchemy ORM,分离 Pydantic schemas
- 新增 service_manager: 服务启动/停止统一管理
- 新增 data_downloader: 基于 xtquant 的数据下载服务
- 简化 main.py: 只启动必要服务 (Redis, Database)
- 更新 .gitignore: 排除 xtquant 数据目录
2025-12-09 17:32:01 +08:00
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
7ca782b27a
feat: 阶段2 Gateway服务完成
...
- 新增 Gateway 服务 (src/gateway/)
- FastAPI 应用框架 (app.py)
- 健康检查路由 (/health, /ping)
- 行情路由 (/api/v1/market/*)
- 交易路由 (/api/v1/trading/*)
- 账户路由 (/api/v1/account/*)
- 回测路由 (/api/v1/backtest/*)
- 修复 Pydantic 模型中 datetime 字段命名冲突
- Gateway 监听端口 8001,支持 Swagger 文档
2025-12-08 22:31:57 +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
9976ea9c73
修复一些导入相关错误
2025-08-06 23:43:29 +08:00
5d81b4a124
初始化QTrade项目 - 完整的量化交易系统
...
核心功能:
- Socket长连接通信架构,性能提升13倍
- 完整的股票数据处理模块,支持xtquant数据源
- MySQL数据库集成,使用Peewee ORM
- 网格交易策略实现
- 多客户端并发支持
项目结构:
- src/data_process_model/ - 数据处理核心模块
- src/network_model/ - Socket和HTTP通信实现
- src/strategy/ - 交易策略模块
- example_and_demos/ - 示例和演示代码
- test/ - 测试文件
主要特性:
- 支持CSV和MySQL双重数据存储
- 自动数据下载和处理流水线
- 实时Socket通信,毫秒级响应
- 完善的错误处理和日志记录
- 模块化设计,易于扩展
性能指标:
- 平均延迟: 0.31ms (HTTP: 4.13ms)
- 理论QPS: 3242 (HTTP: 242)
- 支持50个并发客户端连接
2025-07-22 16:30:30 +08:00