theme-detector by tradermonty/claude-trading-skills
npx skills add https://github.com/tradermonty/claude-trading-skills --skill theme-detector此技能通过分析跨行业动量、成交量和广度信号,检测并排序当前市场热门主题。它能识别看涨(向上动量)和看跌(向下压力)主题,评估生命周期成熟度(新兴/加速/趋势/成熟/衰竭),并提供结合定量数据和叙事分析的信度评分。
三维评分模型:
主要特性:
明确触发词:
隐含触发场景:
何时不应使用:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
检查所需的 API 密钥和依赖项:
# 检查 FINVIZ Elite API 密钥(可选但推荐)
echo $FINVIZ_API_KEY
# 检查 FMP API 密钥(可选,用于估值指标)
echo $FMP_API_KEY
要求:
requests、beautifulsoup4、lxml、pandas、numpy、yfinance可选依赖项:
finvizfinance(用于 FINVIZ Elite 模式)PyYAML(用于 --themes-config 自定义主题)安装:
pip install requests beautifulsoup4 lxml pandas numpy yfinance
运行主检测脚本:
python3 skills/theme-detector/scripts/theme_detector.py \
--output-dir reports/
脚本选项:
# 完整运行(公共 FINVIZ 模式,无需 API 密钥)
python3 skills/theme-detector/scripts/theme_detector.py \
--output-dir reports/
# 使用 FINVIZ Elite API 密钥
python3 skills/theme-detector/scripts/theme_detector.py \
--finviz-api-key $FINVIZ_API_KEY \
--output-dir reports/
# 使用 FMP API 密钥获取增强的股票数据
python3 skills/theme-detector/scripts/theme_detector.py \
--fmp-api-key $FMP_API_KEY \
--output-dir reports/
# 自定义限制
python3 skills/theme-detector/scripts/theme_detector.py \
--max-themes 5 \
--max-stocks-per-theme 10 \
--output-dir reports/
# 显式指定 FINVIZ 模式
python3 skills/theme-detector/scripts/theme_detector.py \
--finviz-mode public \
--output-dir reports/
预期执行时间:
脚本生成两个输出文件:
theme_detector_YYYY-MM-DD_HHMMSS.json - 用于程序化使用的结构化数据theme_detector_YYYY-MM-DD_HHMMSS.md - 人类可读的报告读取 JSON 输出以理解定量结果:
# 查找最新报告
ls -lt reports/theme_detector_*.json | head -1
# 读取 JSON 输出
cat reports/theme_detector_YYYY-MM-DD_HHMMSS.json
对于前 5 个主题(按主题热度评分),执行 WebSearch 查询以确认叙事强度:
搜索模式:
"[主题名称] stocks market [当前月份] [当前年份]"
"[主题名称] sector momentum [当前月份] [当前年份]"
评估叙事信号:
根据发现更新信度等级:
将检测结果与知识库交叉参考:
需查阅的参考文档:
references/cross_sector_themes.md - 主题定义和构成行业references/thematic_etf_catalog.md - 按主题划分的 ETF 敞口选项references/theme_detection_methodology.md - 评分模型详情references/finviz_industry_codes.md - 行业分类参考分析框架:
对于热门看涨主题(热度 >= 70,方向 = 看涨):
对于热门看跌主题(热度 >= 70,方向 = 看跌):
对于新兴主题(热度 40-69,生命周期 = 新兴):
对于衰竭主题(热度 >= 60,生命周期 = 衰竭):
使用报告模板结构向用户呈现最终报告:
# 主题检测报告
**日期:** YYYY-MM-DD
**模式:** FINVIZ Elite / Public
**分析主题数:** N
**数据质量:** [注明任何限制]
## 主题仪表板
[包含热度、方向、生命周期、信度的顶级主题表格]
## 看涨主题详情
[按热度排序的看涨主题详细分析]
## 看跌主题详情
[按热度排序的看跌主题详细分析]
## 所有主题摘要
[完整的主题排名表]
## 行业排名
[表现最佳和最差的行业]
## 行业上涨趋势比率
[如果上涨趋势数据可用,提供行业级聚合数据]
## 方法论说明
[评分模型的简要解释]
将报告保存到 reports/ 目录。
scripts/)主要脚本:
theme_detector.py - 主协调脚本
python3 theme_detector.py [options]theme_classifier.py - 将行业映射到跨行业主题
cross_sector_themes.md 读取主题定义finviz_industry_scanner.py - FINVIZ 行业数据收集
calculators/lifecycle_calculator.py - 生命周期成熟度评估
report_generator.py - 报告输出生成
references/)知识库:
cross_sector_themes.md - 包含行业、ETF、股票和匹配标准的主题定义thematic_etf_catalog.md - 全面的主题 ETF 目录,包含每个主题的数量finviz_industry_codes.md - 完整的 FINVIZ 行业到筛选代码映射theme_detection_methodology.md - 三维评分模型的技术文档assets/)report_template.md - 用于报告生成的 Markdown 模板,包含占位符格式| 特性 | Elite 模式 | Public 模式 |
|---|---|---|
| 行业覆盖 | 所有约 145 个行业 | 所有约 145 个行业 |
| 每个行业股票数 | 完整股票池 | 约 20 只股票(第 1 页) |
| 速率限制 | 请求间隔 0.5 秒 | 请求间隔 2.0 秒 |
| 数据新鲜度 | 实时 | 延迟 15 分钟 |
| 需要 API 密钥 | 是 ($39.50/月) | 否 |
| 执行时间 | 约 2-3 分钟 | 约 5-8 分钟 |
主题方向由构成行业的相对排名多数决定:
_majority_direction() 计算每个主题内看涨与看跌行业的数量;多数方胜出显示映射:"bullish" → LEAD, "bearish" → LAG(参见 report_generator.py::_direction_label())
LEAD 主题表示其构成行业的相对表现优异。LAG 主题可能仍有正的绝对回报——它表示相对表现不佳,而非做空信号。
此分析仅用于教育和信息目的。
版本: 1.0 最后更新: 2026-02-16 API 要求: FINVIZ Elite(推荐)或公共模式(免费);FMP API 可选 执行时间: 约 2-8 分钟,取决于模式 输出格式: JSON + Markdown 覆盖主题: 14+ 个跨行业主题
每周安装量
90
代码仓库
GitHub 星标数
412
首次出现
2026年2月23日
安全审计
安装于
cursor86
github-copilot85
codex85
amp85
kimi-cli85
gemini-cli85
This skill detects and ranks trending market themes by analyzing cross-sector momentum, volume, and breadth signals. It identifies both bullish (upward momentum) and bearish (downward pressure) themes, assesses lifecycle maturity (Emerging/Accelerating/Trending/Mature/Exhausting), and provides a confidence score combining quantitative data with narrative analysis.
3-Dimensional Scoring Model:
Key Features:
Explicit Triggers:
Implicit Triggers:
When NOT to Use:
Check for required API keys and dependencies:
# Check for FINVIZ Elite API key (optional but recommended)
echo $FINVIZ_API_KEY
# Check for FMP API key (optional, used for valuation metrics)
echo $FMP_API_KEY
Requirements:
requests, beautifulsoup4, lxml, pandas, numpy, yfinanceOptional dependencies:
finvizfinance (for FINVIZ Elite mode)PyYAML (for --themes-config custom themes)Installation:
pip install requests beautifulsoup4 lxml pandas numpy yfinance
Run the main detection script:
python3 skills/theme-detector/scripts/theme_detector.py \
--output-dir reports/
Script Options:
# Full run (public FINVIZ mode, no API key required)
python3 skills/theme-detector/scripts/theme_detector.py \
--output-dir reports/
# With FINVIZ Elite API key
python3 skills/theme-detector/scripts/theme_detector.py \
--finviz-api-key $FINVIZ_API_KEY \
--output-dir reports/
# With FMP API key for enhanced stock data
python3 skills/theme-detector/scripts/theme_detector.py \
--fmp-api-key $FMP_API_KEY \
--output-dir reports/
# Custom limits
python3 skills/theme-detector/scripts/theme_detector.py \
--max-themes 5 \
--max-stocks-per-theme 10 \
--output-dir reports/
# Explicit FINVIZ mode
python3 skills/theme-detector/scripts/theme_detector.py \
--finviz-mode public \
--output-dir reports/
Expected Execution Time:
The script generates two output files:
theme_detector_YYYY-MM-DD_HHMMSS.json - Structured data for programmatic usetheme_detector_YYYY-MM-DD_HHMMSS.md - Human-readable reportRead the JSON output to understand quantitative results:
# Find the latest report
ls -lt reports/theme_detector_*.json | head -1
# Read the JSON output
cat reports/theme_detector_YYYY-MM-DD_HHMMSS.json
For the top 5 themes (by Theme Heat score), execute WebSearch queries to confirm narrative strength:
Search Pattern:
"[theme name] stocks market [current month] [current year]"
"[theme name] sector momentum [current month] [current year]"
Evaluate narrative signals:
Update Confidence levels based on findings:
Cross-reference detection results with knowledge bases:
Reference Documents to Consult:
references/cross_sector_themes.md - Theme definitions and constituent industriesreferences/thematic_etf_catalog.md - ETF exposure options by themereferences/theme_detection_methodology.md - Scoring model detailsreferences/finviz_industry_codes.md - Industry classification referenceAnalysis Framework:
For Hot Bullish Themes (Heat >= 70, Direction = Bullish):
For Hot Bearish Themes (Heat >= 70, Direction = Bearish):
For Emerging Themes (Heat 40-69, Lifecycle = Emerging):
For Exhausted Themes (Heat >= 60, Lifecycle = Exhausting):
Present the final report to the user using the report template structure:
# Theme Detection Report
**Date:** YYYY-MM-DD
**Mode:** FINVIZ Elite / Public
**Themes Analyzed:** N
**Data Quality:** [note any limitations]
## Theme Dashboard
[Top themes table with Heat, Direction, Lifecycle, Confidence]
## Bullish Themes Detail
[Detailed analysis of bullish themes sorted by Heat]
## Bearish Themes Detail
[Detailed analysis of bearish themes sorted by Heat]
## All Themes Summary
[Complete theme ranking table]
## Industry Rankings
[Top performing and worst performing industries]
## Sector Uptrend Ratios
[Sector-level aggregation if uptrend data available]
## Methodology Notes
[Brief explanation of scoring model]
Save the report to reports/ directory.
scripts/)Main Scripts:
theme_detector.py - Main orchestrator script
python3 theme_detector.py [options]theme_classifier.py - Maps industries to cross-sector themes
cross_sector_themes.mdfinviz_industry_scanner.py - FINVIZ industry data collection
- Lifecycle maturity assessment
references/)Knowledge Bases:
cross_sector_themes.md - Theme definitions with industries, ETFs, stocks, and matching criteriathematic_etf_catalog.md - Comprehensive thematic ETF catalog with counts per themefinviz_industry_codes.md - Complete FINVIZ industry-to-filter-code mappingtheme_detection_methodology.md - Technical documentation of the 3D scoring modelassets/)report_template.md - Markdown template for report generation with placeholder format| Feature | Elite Mode | Public Mode |
|---|---|---|
| Industry coverage | All ~145 industries | All ~145 industries |
| Stocks per industry | Full universe | ~20 stocks (page 1) |
| Rate limiting | 0.5s between requests | 2.0s between requests |
| Data freshness | Real-time | 15-min delayed |
| API key required | Yes ($39.50/mo) | No |
| Execution time | ~2-3 minutes | ~5-8 minutes |
Theme direction is determined by majority vote of constituent industries' relative rank:
_majority_direction() counts bullish vs. bearish industries within each theme; the majority winsDisplay mapping: "bullish" → LEAD , "bearish" → LAG (see report_generator.py::_direction_label())
A LEAD theme indicates relative outperformance of its constituent industries. A LAG theme may still have positive absolute returns — it indicates relative underperformance, not a short signal.
This analysis is for educational and informational purposes only.
Version: 1.0 Last Updated: 2026-02-16 API Requirements: FINVIZ Elite (recommended) or public mode (free); FMP API optional Execution Time: ~2-8 minutes depending on mode Output Formats: JSON + Markdown Themes Covered: 14+ cross-sector themes
Weekly Installs
90
Repository
GitHub Stars
412
First Seen
Feb 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
cursor86
github-copilot85
codex85
amp85
kimi-cli85
gemini-cli85
DOCX文件创建、编辑与分析完整指南 - 使用docx-js、Pandoc和Python脚本
51,800 周安装
GrepAI Qdrant存储技能:高性能向量搜索,快速处理大型代码库
263 周安装
Browserbase Fetch API:快速获取网页内容、头部和元数据,无需浏览器会话
271 周安装
规划代理 (planning-agent) - AI驱动的软件开发实施规划工具,2025年最佳实践
265 周安装
区块链与Web3开发技能:智能合约、安全审计、DeFi协议实现与多链开发指南
258 周安装
Go gRPC生产环境配置指南:版本化Protobuf、TLS、健康检查与错误处理
261 周安装
Tinybird CLI 指南:本地开发、部署与数据操作完整教程
261 周安装
calculators/lifecycle_calculator.pyreport_generator.py - Report output generation