13 Commits

Author SHA1 Message Date
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
1a0e27878f 配置 .gitignore 以忽略 Python 缓存文件
变更内容:
- 添加标准 Python .gitignore 规则(__pycache__、*.pyc 等)
- 从 Git 仓库移除已跟踪的 Python 缓存文件
- 添加性能分析输出文件的忽略规则

移除的文件:
- scripts/__pycache__/*.pyc (6个文件)
- src/__pycache__/*.pyc (2个文件)

原因:
- Python 缓存文件是自动生成的,不应提交到版本控制
- 这些文件与 Python 版本和操作系统相关,跨环境不兼容
- 遵循 Python 项目标准实践

影响:
- 减小仓库体积
- 避免无意义的差异
- 提高代码审查质量
2026-01-28 16:38:20 +08:00
e5788b8811 增强绘图功能:支持自定义边界线拟合数据源
新增功能:
- 添加 --plot-boundary-source 参数,允许选择边界线拟合数据源(高低价/收盘价)
- 添加 --show-high-low 参数,可选显示日内高低价范围
- 当使用收盘价拟合时,自动重新计算贴合度指标
- 图例自动标注当前使用的数据源
- 详细模式下,枢轴点标注位置根据数据源自适应调整

技术细节:
- 检测算法仍使用高低价(保持一致性)
- 新参数仅影响图表展示,不影响检测结果
- 贴合度计算逻辑根据数据源动态调整

文件修改:
- scripts/pipeline_converging_triangle.py: 添加参数支持和参数传递
- scripts/plot_converging_triangles.py: 实现核心绘图逻辑增强

使用示例:
python scripts/pipeline_converging_triangle.py --plot-boundary-source close
python scripts/plot_converging_triangles.py --plot-boundary-source close --show-high-low
2026-01-28 16:35:54 +08:00
24652b5790 Enhance converging triangle analysis with boundary utilization scoring and detailed chart mode
- Introduced a new boundary utilization score to measure price proximity to triangle boundaries, improving the accuracy of strength assessments.
- Updated scoring weights to incorporate boundary utilization, adjusting the contributions of convergence, volume, and fitting scores.
- Added detailed chart mode in the stock viewer, allowing users to toggle between standard and detailed views with additional metrics displayed.
- Enhanced documentation to reflect new features, including usage instructions for the boundary utilization score and detailed chart mode.
- Improved error handling in the stock viewer for better user experience.
2026-01-27 18:54:56 +08:00
22582851a1 Enhance converging triangle detection with new features and documentation updates
- Introduced an interactive HTML stock viewer for visualizing strength scores and filtering stocks based on user-defined thresholds.
- Added `--all-stocks` parameter to generate charts for all 108 stocks, including those not meeting convergence criteria.
- Implemented a new scoring system for breakout strength, incorporating fitting adherence to improve accuracy.
- Updated multiple documentation files, including usage instructions and feature overviews, to reflect recent enhancements.
- Improved error handling and file naming conventions to ensure compatibility across platforms.
2026-01-27 16:17:28 +08:00
95d13b2cce Enhance converging triangle analysis with detailed mode and outlier removal algorithm
- Added `--show-details` parameter to `pipeline_converging_triangle.py` for generating detailed charts that display all pivot points and fitting lines.
- Implemented an iterative outlier removal algorithm in `fit_pivot_line` to improve the accuracy of pivot point fitting by eliminating weak points.
- Updated `USAGE.md` to include new command examples for the detailed mode.
- Revised multiple documentation files to reflect recent changes and improvements in the pivot detection and visualization processes.
2026-01-26 18:43:18 +08:00
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
dab9768b3b Update documentation and outputs for converging triangle analysis
- Revised README.md to enhance clarity on core functionalities and usage instructions.
- Updated USAGE.md to reflect the new pipeline script and its parameters.
- Modified .gitignore to include additional output files for better management.
- Removed outdated output files (all_results.csv, report.md, strong_breakout_up.csv, strong_breakout_down.csv) to streamline data handling.
- Improved structure and descriptions in documentation for better user guidance.
2026-01-22 15:06:25 +08:00
5455f8e456 Implement converging triangle detection pipeline and enhance documentation
- Added pipeline_converging_triangle.py for streamlined execution of detection, reporting, and chart generation.
- Introduced triangle_config.py for centralized parameter management across scripts.
- Updated plot_converging_triangles.py to utilize parameters from the new config file.
- Revised report_converging_triangles.py to reflect dynamic detection window based on configuration.
- Enhanced existing scripts for improved error handling and output consistency.
- Added new documentation files for usage instructions and parameter configurations.
2026-01-22 11:29:04 +08:00
8dea3fbccb Enhance converging triangle analysis with new scripts and data outputs
- Updated all_results.csv with additional stock data and breakout strength metrics.
- Revised report.md to improve clarity and detail on stock selection criteria and results.
- Expanded strong_breakout_down.csv and strong_breakout_up.csv with new entries reflecting recent analysis.
- Introduced new chart images for selected stocks to visualize breakout patterns.
- Added plot_converging_triangles.py script for generating visualizations of stocks meeting convergence criteria.
- Enhanced report_converging_triangles.py to allow for date-specific reporting and improved output formatting.
- Optimized run_converging_triangle.py for performance and added execution time logging.
2026-01-22 10:00:47 +08:00
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
f04a22c3d8 first commit 2026-01-21 11:19:36 +08:00