technical-patterns-lab/docs/K线图说明.md
褚宏光 3538b214ba Enhance stock analysis features with K线图 and daily best reporting
- Upgraded charting functionality from line graphs to K线图 for improved technical analysis.
- Introduced a new daily best stocks report, outputting the top-performing stocks over the last 500 days.
- Implemented automatic logging of execution details for better traceability.
- Updated the .gitignore to include new output files related to the K线图 and logs.

Files modified:
- scripts/plot_converging_triangles.py: Enhanced to support K线图 rendering.
- scripts/run_converging_triangle.py: Added logging and daily best reporting features.
- README.md: Updated to reflect new features and usage instructions.
- New files: docs/K线图说明.md for detailed K线图 usage and features.
2026-01-29 09:09:29 +08:00

159 lines
3.5 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.

# K线图功能说明
## 版本更新 (2026-01-28)
图表展示从**折线图升级为K线图**,提供更专业的技术分析视角。
---
## K线图特点
### 1. K线组成
```
| ← 上影线(最高价)
┌─┴─┐
│ │ ← 实体(开盘价到收盘价)
└─┬─┘
| ← 下影线(最低价)
```
### 2. 颜色含义
| 颜色 | 含义 | 实体填充 |
|------|------|---------|
| 🔴 红色 | 涨(收盘 ≥ 开盘)| 空心(白色) |
| 🟢 绿色 | 跌(收盘 < 开盘| 实心绿色 |
### 3. 特殊形态
- **十字星**开盘价 收盘价显示为水平线
- **长影线**当日波动大
- **光头光脚**无上/下影线趋势强劲
---
## 图表内容
### 主图K线 + 趋势线)
1. **K线**展示每日OHLC开高低收
2. **上沿线**红色虚线收敛三角形的压力线
3. **下沿线**绿色虚线收敛三角形的支撑线
4. **当前日标记**蓝色虚线检测日期的位置
### 副图(成交量)
- **柱状图**展示每日成交量
- **颜色**与K线颜色一致红涨绿跌
---
## 使用方法
### 简洁模式(默认)
```bash
python scripts/plot_converging_triangles.py
```
**显示内容**
- K线图
- 上下沿趋势线
- 成交量
- 基础指标
### 详细模式
```bash
python scripts/plot_converging_triangles.py --show-details
```
**额外显示**
- 所有枢轴点高点/低点
- 拟合选中的关键点
- 更多技术指标
### 边界线拟合选项
```bash
# 使用高低价拟合(默认,推荐)
python scripts/plot_converging_triangles.py --plot-boundary-source hl
# 使用收盘价拟合(更平滑)
python scripts/plot_converging_triangles.py --plot-boundary-source close
```
**区别**
- `hl`高低价趋势线更贴近极值更符合技术分析习惯
- `close`收盘价趋势线更平滑噪音更少
---
## 输出文件
### 简洁模式
- 文件名`YYYYMMDD_股票代码_股票名称.png`
- 示例`20260120_SH600000_浦发银行.png`
### 详细模式
- 文件名`YYYYMMDD_股票代码_股票名称_detail.png`
- 示例`20260120_SH600000_浦发银行_detail.png`
**优点**两种模式文件名不同可以同时保留对比
---
## 技术分析应用
### 1. 观察收敛形态
- **对称三角形**上沿向下 + 下沿向上
- **上升三角形**上沿水平 + 下沿向上
- **下降三角形**上沿向下 + 下沿水平
### 2. 识别突破信号
- **向上突破**K线实体突破上沿线
- **向下突破**K线实体跌破下沿线
- **成交量确认**突破时成交量放大
### 3. 评估形态质量
- **收敛比例**数值越小收敛越充分
- **触碰次数**触碰上下沿次数越多形态越可靠
- **强度分**综合评分0~1越高越强
---
## 与折线图对比
| 特性 | 折线图 | K线图 |
|------|--------|-------|
| 信息量 | 仅收盘价 | OHLC完整信息 |
| 趋势判断 | 简单 | 更准确 |
| 反转信号 | 不明显 | 清晰可见 |
| 专业性 | 一般 | 更专业 |
| 推荐度 | - | **推荐** |
---
## 配置说明
相关配置位于 `scripts/triangle_config.py`
```python
# 图表显示范围
DISPLAY_WINDOW = 500 # 显示最近500个交易日
# 边界线拟合默认方式
# 在 pipeline_converging_triangle.py 中:
# --plot-boundary-source hl (默认)
```
---
**文档版本**: v1.0
**创建日期**: 2026-01-28
**相关文档**: `USAGE.md`, `性能优化执行总结.md`