technical-patterns-lab/docs/converging_triangles_outputs.md
褚宏光 543572667b Add initial implementation of converging triangle detection algorithm and related documentation
- Created README.md and USAGE.md for project overview and usage instructions.
- Added core algorithm in src/converging_triangle.py for batch processing of stock data.
- Introduced data files (open.pkl, high.pkl, low.pkl, close.pkl, volume.pkl) for OHLCV data.
- Developed output documentation for results and breakout strength calculations.
- Implemented scripts for running the detection and generating reports.
- Added SVG visualizations and markdown documentation for algorithm details and usage examples.
2026-01-21 18:02:58 +08:00

42 lines
2.1 KiB
Markdown
Raw 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.

# 收敛三角形输出说明
本文档说明 `outputs/converging_triangles` 目录下 CSV 的含义与字段。
输出由 `scripts/run_converging_triangle.py` 生成。
## 输出文件
- `all_results.csv`:检测结果汇总。默认仅包含有效三角形(`ONLY_VALID=True`)。
- `strong_breakout_up.csv`:强势向上突破子集(`breakout_strength_up > 0.3`)。
- `strong_breakout_down.csv`:强势向下突破子集(`breakout_strength_down > 0.3`)。
## 字段说明
| 字段 | 说明 |
| --- | --- |
| `stock_idx` | 股票索引在矩阵中的行号0 起)。 |
| `date_idx` | 日期索引在日期数组中的列号0 起)。 |
| `is_valid` | 是否识别到有效收敛三角形。 |
| `breakout_strength_up` | 向上突破强度0~1。 |
| `breakout_strength_down` | 向下突破强度0~1。 |
| `upper_slope` | 上沿趋势线斜率。 |
| `lower_slope` | 下沿趋势线斜率。 |
| `width_ratio` | 收敛比(末端宽度 / 起始宽度,越小越收敛)。 |
| `touches_upper` | 上沿触碰次数(枢轴高点落在容差内的次数)。 |
| `touches_lower` | 下沿触碰次数(枢轴低点落在容差内的次数)。 |
| `apex_x` | 上下沿交点的 x 坐标(窗口内索引;平行时可能为 `inf`)。 |
| `breakout_dir` | 突破方向:`up` / `down` / `none`。 |
| `volume_confirmed` | 是否放量确认突破(突破时成交量 > 均量 × `vol_k`)。 |
| `false_breakout` | 假突破标记(当前实现为空,占位)。 |
| `window_start` | 窗口起始位置(窗口内索引,通常为 0。 |
| `window_end` | 窗口结束位置(窗口内索引,通常为 `window-1`)。 |
| `stock_code` | 股票代码(脚本追加)。 |
| `stock_name` | 股票名称(脚本追加)。 |
| `date` | 真实交易日日期(脚本追加)。 |
## 备注
- `breakout_strength_up/down` 由价格突破幅度、收敛程度与成交量放大综合计算,
详细公式见 `docs/突破强度计算方法.md`
- `date_idx``date``stock_idx``stock_code/stock_name` 的映射来自
`data/*.pkl` 的元数据(脚本在输出时补充)。