Files
myquant/continuation.md
simonandClaude Opus 4.7 2f1d8b4d03 feat: djapi 数据源归一化 + bug 修复 + 废弃 getDivData_AK
- 新增 djapi/api/stock/data_source.py 统一数源入口 (Tushare 单例)
- 迁移 10 个模块至统一数据源入口
- 废弃 getDivData_AK.py
- 修复 getStockDiv2.py / smoothBrush.py 等模块
- indexDatas API 参数 tscode 类型修正 (股票→指数代码)
- views.py + urls.py 接口清理
- continuation.md 状态更新

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-16 15:01:04 +08:00

84 lines
3.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# continuation.md — cc-cursor 项目状态
生成时间:2026-06-07(全部 Sprint 完成 + 生产加固 + djapi 数据源归一化 + Git 初始化)
---
## Git 状态
- 仓库:https://github.com/Simon2046/myquant
- 分支:`main`
- commit`271a934` — Initial commit: cc-cursor 全链路量化研究平台
- 文件:293 个文件,59,598 行
- 已排除:`.env``mcp-servers/serena``__pycache__``.parquet``.db`
---
## 全部 Sprint 完成 ✅
| Sprint | 模块 | 状态 |
|--------|------|------|
| 0 | 基础设施(DataManager + MariaDB | ✅ |
| 1 | 因子引擎(34 因子 / 12 分类) | ✅ |
| 2 | VectorBT 回测(5 策略 + 截面 + BacktestReport | ✅ |
| 3 | Optuna 优化(+ Walk-Forward | ✅ |
| 4 | ML 模型(LightGBM + CatBoost + MLStrategy | ✅ |
| 5 | Qwen 情绪因子(三源新闻 + 日期对齐) | ✅ |
| 6 | Agent 系统(4 Agent + CLI + 日报 .md/.html | ✅ |
---
## 生产稳定性加固(14 项)
| # | 项 | 文件 |
|---|-----|------|
| 1 | Tushare 双数据源(优先) | `finance/data/data_manager.py` |
| 2 | 指数 vs 个股自动路由 | `finance/data/sources/akshare_source.py` |
| 3 | SSH 自动恢复(多次重连 + pool_pre_ping | `finance/database/connection.py` |
| 4 | save_daily 先删后插(防主键冲突) | `finance/database/dao.py` |
| 5 | load_dotenv 绝对路径 + 模块加固 | `finance/config/settings.py` + 3 文件 |
| 6 | 日报 5d/20d 修复(idx=-1→pos=len-1 | `finance/agents/report_agent.py` |
| 7 | RiskAgent 改用上证指数 | `finance/agents/risk_agent.py` |
| 8 | 日报增加"昨日对比" + 数据截止 | `finance/agents/report_agent.py` |
| 9 | mac_report 表 utf8mb4 + DATE + DATETIME | `finance/database/models.py` |
| 10 | 日报自动存入 DB + emoji 兼容 | `finance/reports/storage.py` + 8 CLI |
| 11 | CLAUDE-*.md 文档化 9 条已知 Bug | `CLAUDE-data.md` + `CLAUDE-agents.md` |
| 12 | demo 脚本全参数化 | `finance/cli/demo_*.py` |
| 13 | **djapi 数据源归一化(10→1 入口)** | `djapi/api/stock/data_source.py` |
| 14 | **indexDatas API 参数修正 + 容错** | `djapi/api/views.py` + `getIndexs.py` |
---
## djapi 数据源归一化
- 新增 `djapi/api/stock/data_source.py` — 统一入口
- `get_tushare_pro()` — 全局单例(线程安全)
- `get_daily()` — 双源 fallback (Tushare→AkShare)
- `get_mysql_db()` — MySQL 全局单例
- Token 兼容 `TUSHARE_TS_TOKEN` / `TUSHARE_TOKEN`
- 10 个模块迁移完成
- `getDivData_AK.py` 标记废弃
- `getIndexs.py` 修复:`index_dailybasic` 失败不阻塞,异常 raise 而非静默返回空
- `views.py` 修正:`indexDatas` 参数 `index_name``tscode`,描述从"股票代码"→"指数代码",新增 `_PARAM_INDEX_CODE`
- 已部署到 `api.doorcome.cn`
---
## CLI 命令
```bash
agent_cli.py daily / picks / risk / research / report / warmup
demo_*.py(全部支持 --ts_code --date 等参数)
```
## 文档
- `CLAUDE.md` — 入口 + 路由 + 多步任务规则
- `CLAUDE-data.md` — 数据层 + 5 条已知 Bug
- `CLAUDE-factors.md` — 因子引擎
- `CLAUDE-backtest.md` — 回测 + 优化
- `CLAUDE-ml.md` — ML 模型
- `CLAUDE-agents.md` — Agent + CLI + 4 条已知 Bug
- `CLAUDE-reference.md` — 因子/表结构速查
- `docs/usage.md` + `docs/usage.html` — 使用指南