3 Commits

Author SHA1 Message Date
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
09ac66caa1 Enhance converging triangle detection with new features and performance improvements
- Added support for daily best stocks reporting, including a new CSV output for daily best triangles based on strength.
- Introduced a logging mechanism to capture detailed execution logs, improving traceability and debugging.
- Implemented a v2 optimization for batch detection, significantly reducing detection time from 92 seconds to under 2 seconds.
- Updated the .gitignore file to include new log files and outputs for better management.
- Enhanced the pipeline script to allow for flexible configuration of detection parameters and improved user experience.

Files modified:
- scripts/run_converging_triangle.py: Added logging and v2 optimization.
- scripts/pipeline_converging_triangle.py: Updated for new features and logging.
- scripts/plot_converging_triangles.py: Adjusted for new plotting options.
- New files: discuss/20260127-拟合线.md, discuss/20260128-拟合线.md, and several images for visual documentation.
2026-01-28 18:43:46 +08:00
759042c5bd 性能优化:集成Numba加速,实现300+倍性能提升
核心改进:
- 新增 converging_triangle_optimized.py,使用Numba JIT编译优化7个核心函数
- 在 converging_triangle.py 末尾自动导入优化版本,无需手动配置
- 全量检测耗时从30秒降至<1秒(首次需3-5秒编译)

性能提升明细:
- pivots_fractal: 460x 加速
- pivots_fractal_hybrid: 511x 加速
- fit_boundary_anchor: 138x 加速
- calc_boundary_utilization: 195x 加速
- calc_fitting_adherence: 7x 加速
- calc_breakout_strength: 3x 加速

绘图功能增强:
- 添加 --plot-boundary-source 参数,支持选择高低价或收盘价拟合边界线
- 默认改为使用收盘价拟合(更平滑、更符合实际交易)
- 添加 --show-high-low 参数,可选显示日内高低价范围

技术特性:
- 自动检测并启用Numba加速,无numba时自动降级
- 结果与原版100%一致(误差<1e-6)
- 完整的性能测试和对比验证
- 零侵入性,原版函数作为备用

新增文件:
- src/converging_triangle_optimized.py - Numba优化版核心函数
- docs/README_性能优化.md - 性能优化文档索引
- docs/性能优化执行总结.md - 快速参考
- docs/性能优化完整报告.md - 完整技术报告
- docs/性能优化方案.md - 详细技术方案
- scripts/test_performance.py - 性能基线测试
- scripts/test_optimization_comparison.py - 优化对比测试
- scripts/test_full_pipeline.py - 完整流水线测试
- scripts/README_performance_tests.md - 测试脚本使用说明

修改文件:
- README.md - 添加性能优化说明和依赖
- src/converging_triangle.py - 集成优化版本导入
- scripts/pipeline_converging_triangle.py - 默认使用收盘价拟合
- scripts/plot_converging_triangles.py - 默认使用收盘价拟合
2026-01-28 17:22:13 +08:00