feat(djapi): 新增日报查询 API(news/reports + news/events)及文档
- api/report/ 包:query(连库+SQL)/ views(2 视图)/ serializers(OpenAPI)/ tests(17 单测) - urls.py 注册 news/reports/、news/events/;settings.py SPECTACULAR 加「日报」tag - .env.example 补 NEWS_DB_* 占位配置;README/continuation.md 更新 - docs/news_report_api.md 使用手册;CLAUDE*.md 修正 CLI 路径为 finance/ 前缀
This commit is contained in:
@@ -10,13 +10,26 @@ cc-cursor — Mac Mini 单机量化研究平台。全链路:Data → Factor
|
||||
| 因子引擎 + 情绪 | `CLAUDE-factors.md` | `from factors.registry import get_factor` |
|
||||
| 回测 + 优化 | `CLAUDE-backtest.md` | `from backtest.vectorbt.engine import VectorBTEngine` |
|
||||
| ML 模型 | `CLAUDE-ml.md` | `from models.lightgbm.model import LightGBMModel` |
|
||||
| Agent 系统 + CLI | `CLAUDE-agents.md` | `python cli/agent_cli.py daily` |
|
||||
| Agent 系统 + CLI | `CLAUDE-agents.md` | `python finance/cli/agent_cli.py daily` |
|
||||
|
||||
## 工作区布局
|
||||
|
||||
| 目录 | 内容 |
|
||||
|------|------|
|
||||
| `finance/` | 核心量化引擎(**代码实际位置**)。代码内 import 用顶层名 `data.*`/`factors.*` 等 — 由 CLI 把 `finance/` 加入 sys.path;文件路径为 `finance/data/xxx.py` 等 |
|
||||
| `djapi/` | Django API 子项目,有独立 `djapi/CLAUDE.md` |
|
||||
| `shared/script/` | `autossh.sh` — MariaDB SSH 隧道 |
|
||||
| `docs/` | `usage.md` / `usage.html` 使用指南、`news_report_api.md` 新闻接口文档;**新建 md 一律放这里** |
|
||||
| `finance/strategy` `portfolio` `execution` `scheduler/` | 空壳占位(仅 `__init__.py`),逻辑未落地,别误以为有实现 |
|
||||
| `finance/reports/` | 日报输出 `daily_YYYYMMDD.{md,html}` |
|
||||
|
||||
## 环境
|
||||
|
||||
```bash
|
||||
conda activate quant # Python 3.11.13
|
||||
bash shared/script/autossh.sh # DB SSH 隧道
|
||||
bash shared/script/autossh.sh # DB SSH 隧道 (本地 13306 → 远程 3306)
|
||||
|
||||
# 环境变量在 finance/.env(示例见 finance/.env.example):QWEN / TUSHARE / DB / 情绪范围
|
||||
```
|
||||
|
||||
## 任务→文档路由
|
||||
@@ -28,7 +41,7 @@ bash shared/script/autossh.sh # DB SSH 隧道
|
||||
| 回测/优化/策略相关 | `CLAUDE-backtest.md` |
|
||||
| ML 模型/特征工程相关 | `CLAUDE-ml.md` |
|
||||
| Agent/CLI/报告相关 | `CLAUDE-agents.md` |
|
||||
| API 参数/第三方库 | 调用 `mcp__mcphub__context7-query-docs` |
|
||||
| 第三方库 API/参数 | `web_fetch` / `research` 查官方文档 |
|
||||
| 因子名/类名/表结构速查 | `CLAUDE-reference.md` |
|
||||
|
||||
## 多步任务规则
|
||||
@@ -51,18 +64,20 @@ bash shared/script/autossh.sh # DB SSH 隧道
|
||||
## CLI 常用命令
|
||||
|
||||
```bash
|
||||
python cli/agent_cli.py daily # 5步完整流程
|
||||
python cli/agent_cli.py picks 15 # 选股
|
||||
python cli/agent_cli.py risk # 风险评估
|
||||
python cli/agent_cli.py report 20260603 # 生成日报
|
||||
python cli/agent_cli.py warmup 50 # 首次预热缓存
|
||||
python finance/cli/agent_cli.py daily # 5步完整流程
|
||||
python finance/cli/agent_cli.py picks 15 # 选股
|
||||
python finance/cli/agent_cli.py risk # 风险评估
|
||||
python finance/cli/agent_cli.py research # 因子研究
|
||||
python finance/cli/agent_cli.py report 20260603 # 生成日报
|
||||
python finance/cli/agent_cli.py warmup 50 # 首次预热缓存
|
||||
|
||||
python cli/demo_data_manager.py --ts_code 600519.SH
|
||||
python cli/demo_factor_engine.py --ts_code 300750.SZ
|
||||
python cli/demo_backtest.py --ts_code 000001.SZ
|
||||
python cli/demo_optimizer.py --ts_code 000001.SZ --trials 100
|
||||
python cli/demo_ml.py --ts_code 000001.SZ --lookahead 5
|
||||
python cli/demo_sentiment_detail.py --ts_code 600519.SH --date 20260603
|
||||
python finance/cli/demo_data_manager.py --ts_code 600519.SH
|
||||
python finance/cli/demo_factor_engine.py --ts_code 300750.SZ
|
||||
python finance/cli/demo_backtest.py --ts_code 000001.SZ
|
||||
python finance/cli/demo_optimizer.py --ts_code 000001.SZ --trials 100
|
||||
python finance/cli/demo_ml.py --ts_code 000001.SZ --lookahead 5
|
||||
python finance/cli/demo_sentiment.py --ts_code 600519.SH
|
||||
python finance/cli/demo_sentiment_detail.py --ts_code 600519.SH --date 20260603
|
||||
```
|
||||
|
||||
## 技术栈
|
||||
|
||||
Reference in New Issue
Block a user