褚宏光 6d545eb231 Enhance converging triangle detection with new features and documentation updates
- Added support for a detailed chart mode in plot_converging_triangles.py, allowing users to visualize all pivot points and fitting lines.
- Improved pivot fitting logic to utilize multiple representative points, enhancing detection accuracy and reducing false positives.
- Introduced a new real-time detection mode with flexible zone parameters for better responsiveness in stock analysis.
- Updated README.md and USAGE.md to reflect new features and usage instructions.
- Added multiple documentation files detailing recent improvements, including pivot point fitting and visualization enhancements.
- Cleaned up and archived outdated scripts to streamline the project structure.
2026-01-26 16:21:36 +08:00

138 lines
3.9 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.

# Scripts Archive
本目录存放已归档的脚本文件。
---
## 📦 归档内容
### 演示脚本Demo Scripts
这些脚本用于演示和教学,但日常使用频率较低:
#### 1. demo_pivot_detection.py
- **用途**: 枢轴点检测原理可视化演示
- **功能**: 对比不同 k 值3, 8, 15的检测效果
- **输出**: 生成图表到 `docs/images/pivot_detection_demo.png`
- **运行**: `python scripts/archive/demo_pivot_detection.py`
- **适用**: 学习枢轴点检测原理、教学培训
#### 2. demo_segmentation.py
- **用途**: 分段选择算法演示
- **功能**: 展示如何从多个枢轴点中选择代表点
- **演示案例**:
- 6个高点 → 分3段 → 选3个最高点
- 4个低点 → 不分段 → 使用所有点
- 8个高点 → 分3段 → 选3个最高点
- **运行**: `python scripts/archive/demo_segmentation.py`
- **适用**: 理解趋势线拟合算法、调试拟合问题
#### 3. demo_flexible_zone.py
- **用途**: FLEXIBLE_ZONE 参数效果演示
- **功能**: 对比不同 flex 值1, 3, 5, 7, 10, 15的影响
- **演示场景**:
- 基础演示:不同 flex 值捕获的枢轴点数量
- 实际场景:股票突破三角形的实时检测
- **运行**: `python scripts/archive/demo_flexible_zone.py`
- **适用**: 选择合适的 FLEXIBLE_ZONE 值、理解实时模式
---
### 旧版本脚本Legacy Scripts
#### 4. run_sym_triangle_json.py
- **用途**: 旧版对称三角形检测JSON输入
- **状态**: 已被新版 `run_converging_triangle.py` 替代
- **保留原因**: 历史参考
#### 5. run_sym_triangle_pkl.py
- **用途**: 旧版对称三角形检测PKL输入
- **状态**: 已被新版 `run_converging_triangle.py` 替代
- **保留原因**: 历史参考
---
## 🔍 为什么归档?
### 演示脚本归档原因
1. **使用频率低**: 主要用于学习和教学,不是日常工作流的一部分
2. **功能完整**: 文档已经很详细,代码作为补充材料
3. **保持简洁**: 主目录只保留核心运行脚本
### 旧版本脚本归档原因
1. **功能已替代**: 新版本更强大、更完善
2. **历史参考**: 保留供对比和回溯
3. **避免混淆**: 防止误用旧版本
---
## 📚 相关文档
演示脚本对应的文档(这些文档更详细、更容易理解):
- **枢轴点检测**: `docs/枢轴点检测原理.md`
- **分段选择**: `docs/枢轴点分段选择算法详解.md`
- **实时模式**: `docs/实时模式使用指南.md`
- **FAQ**: `docs/FAQ_为什么某些低点不是枢轴点.md`
---
## 🎯 当前主要脚本
主目录 `scripts/` 中保留的核心脚本:
### 运行脚本
-`run_converging_triangle.py` - 批量检测三角形
-`plot_converging_triangles.py` - 生成图表
-`pipeline_converging_triangle.py` - 完整流水线
-`report_converging_triangles.py` - 生成报告
### 测试脚本
-`test_realtime_mode.py` - 实时模式测试
### 配置文件
-`triangle_config.py` - 统一配置
---
## 📝 使用建议
### 日常使用
直接使用主目录的核心脚本即可,无需关注归档脚本。
### 学习和研究
如果想深入理解算法原理,可以运行归档目录中的演示脚本:
```bash
# 学习枢轴点检测
python scripts/archive/demo_pivot_detection.py
# 理解分段选择
python scripts/archive/demo_segmentation.py
# 研究实时模式
python scripts/archive/demo_flexible_zone.py
```
### 教学和培训
演示脚本非常适合用于教学:
- 生成可视化图表
- 逐步展示算法过程
- 对比不同参数的效果
---
## 🗂️ 归档历史
| 日期 | 文件 | 原因 |
|------|------|------|
| 2026-01-26 | demo_*.py (3个) | 演示脚本,日常使用频率低 |
| 之前 | run_sym_triangle_*.py (2个) | 旧版本,已被新版替代 |
---
**注意**: 归档脚本仍然可以正常运行,只是不再是主要工作流的一部分。