8 Commits

Author SHA1 Message Date
7bdcb474ba Add triangle detection API and documentation
- Introduced a new API for converging triangle detection, including the main function `detect_matrix()` for batch processing of stock data.
- Added detailed documentation for the API, covering usage examples, parameter configurations, and output structures.
- Created new markdown files for reference and usage instructions, enhancing the overall documentation quality.

New files:
- `src/triangle_detector_api.py`: Core API implementation.
- `docs/triangle_api_reference.md`: Comprehensive API reference documentation.
- `discuss/20260129-三角形强度.md`: Documentation for triangle strength detection functions.
- `docs/2026-01-29_三角形数据_server.md`: Detailed usage of the triangle detection functions.
2026-01-29 13:13:52 +08:00
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
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