Skip to content

feat: 形态选股 + 板块热力图#13

Merged
henrylin99 merged 19 commits into
masterfrom
feat/pattern-screening-and-heatmap
Jun 7, 2026
Merged

feat: 形态选股 + 板块热力图#13
henrylin99 merged 19 commits into
masterfrom
feat/pattern-screening-and-heatmap

Conversation

@henrylin99

Copy link
Copy Markdown
Owner

新增功能

形态选股

  • 新增 PatternScreenService:读取 data/data.parquet,支持 7 组 131 个形态字段的纯 AND 筛选
  • 新增 API:/api/pattern-screen/groups + /api/pattern-screen/screen
  • 新增页面:/pattern-screen/,左侧分组筛选面板 + 右侧结果表格
  • 勾选即时筛选,表头排序,分页
  • 导航栏添加入口

板块热力图

  • 新增 HeatmapService:按行业聚合数据
  • 新增页面:/heatmap/,ECharts treemap + 个股表格

测试

  • 22 个新测试(16 service + 6 API),全部通过
  • 372 个现有测试不受影响

henrylin99 and others added 19 commits June 7, 2026 19:35
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add HeatmapService to aggregate stock data by industry sector
- Reads from data/data.parquet and filters suspended stocks (close == 0)
- Returns market-cap weighted average pct_chg per sector
- Provides individual stock details with all required fields
- Includes comprehensive test suite (8 tests, all passing)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Create app/routes/heatmap.py blueprint with index route
- Register heatmap_routes in app/__init__.py
- Add nav link in base.html between 选股筛选 and 多因子模型
- Route renders heatmap.html with sectors, stocks, and trade_date
- Includes error handling for missing data

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add pattern_screen_api blueprint with /api/pattern-screen/groups and /api/pattern-screen/screen endpoints
- Groups endpoint returns pattern metadata with hit counts
- Screen endpoint filters stocks by selected patterns with sorting/pagination
- Register blueprint in app/__init__.py

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Created page route in app/routes/pattern_screen.py
- Registered pattern_screen_bp blueprint in app/__init__.py
- Added navigation link in app/templates/base.html
- Created complete template with left filter panel and right result table
- Template includes search, accordion groups, pagination, and sorting

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1. run.py: revert debug=True on 0.0.0.0, use debug=False
2. pattern_screen: fix stale updateSelectedCount() in resetFilters
3. heatmap: sync activeIndustry closure on close button click
4. include test files (force-added, gitignored by tests/)
@henrylin99 henrylin99 merged commit d952f52 into master Jun 7, 2026
0 of 16 checks passed
@henrylin99 henrylin99 deleted the feat/pattern-screening-and-heatmap branch June 7, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant