sector-analyst
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSector Analyst
行业分析技能
Overview
概述
This skill enables comprehensive analysis of sector rotation and market cycle positioning by fetching uptrend ratio data from TraderMonty's public CSV dataset. It ranks sectors, calculates cyclical vs defensive risk regime scores, identifies overbought/oversold conditions, and estimates the current market cycle phase. Chart images can optionally supplement the data-driven analysis with industry-level detail.
本技能通过从TraderMonty的公开CSV数据集获取上涨趋势比率数据,实现对行业轮动和市场周期定位的全面分析。它可对行业进行排名、计算周期型vs防御型风险体系得分、识别超买/超卖状态,并估算当前市场周期阶段。还可选择使用图表图片,为基于数据的分析补充行业层面的细节。
When to Use This Skill
适用场景
Use this skill when:
- User requests sector rotation analysis (no chart images required)
- User asks about cyclical vs defensive positioning
- User wants to know which sectors are overbought or oversold
- User requests market cycle phase estimation
- User provides sector performance charts for supplementary analysis
- User asks for sector-based scenario analysis or predictions
Example user requests:
- "Run a sector rotation analysis"
- "Which sectors are leading — cyclical or defensive?"
- "Are any sectors overbought right now?"
- "What phase of the market cycle are we in?"
- "Analyze these sector performance charts and tell me where we are in the market cycle"
以下场景可使用本技能:
- 用户请求行业轮动分析(无需图表图片)
- 用户询问周期型vs防御型资产配置情况
- 用户想了解哪些行业处于超买或超卖状态
- 用户请求估算市场周期阶段
- 用户提供行业表现图表以辅助分析
- 用户要求基于行业的情景分析或预测
用户请求示例:
- "Run a sector rotation analysis"
- "Which sectors are leading — cyclical or defensive?"
- "Are any sectors overbought right now?"
- "What phase of the market cycle are we in?"
- "Analyze these sector performance charts and tell me where we are in the market cycle"
Prerequisites
前置条件
- Python 3.8+ with library (for CSV fetching)
requests - No API keys required — data is fetched from a public GitHub repository
- Optional: Sector performance chart images for supplementary analysis
- Python 3.8及以上版本,需安装库(用于获取CSV数据)
requests - 无需API密钥——数据从公开GitHub仓库获取
- 可选:用于辅助分析的行业表现图表图片
Data Source
数据源
Sector uptrend ratios are fetched from TraderMonty's public GitHub repository (no API key required):
- Sector Summary: — uptrend ratio, trend, slope, and status per sector
sector_summary.csv - Freshness Check: — max(date) used to verify data recency
uptrend_ratio_timeseries.csv
行业上涨趋势比率从TraderMonty的公开GitHub仓库获取(无需API密钥):
- 行业汇总:——包含各行业的上涨趋势比率、趋势、斜率及状态
sector_summary.csv - 新鲜度校验:——通过max(date)验证数据时效性
uptrend_ratio_timeseries.csv
Running the Script
运行脚本
bash
undefinedbash
undefinedDefault: fetch CSV, print human-readable analysis
Default: fetch CSV, print human-readable analysis
python3 scripts/analyze_sector_rotation.py
python3 scripts/analyze_sector_rotation.py
JSON output
JSON output
python3 scripts/analyze_sector_rotation.py --json
python3 scripts/analyze_sector_rotation.py --json
Save to file
Save to file
python3 scripts/analyze_sector_rotation.py --save --output-dir reports/
undefinedpython3 scripts/analyze_sector_rotation.py --save --output-dir reports/
undefinedAnalysis Workflow
分析流程
Follow this structured workflow:
遵循以下结构化流程:
Step 1: CSV Data Collection
步骤1:CSV数据收集
- Run the analysis script:
python3 scripts/analyze_sector_rotation.py - Extract from the output:
- Sector ranking by uptrend ratio
- Risk regime (cyclical vs defensive) and score
- Overbought/oversold sectors
- Cycle phase estimate and confidence level
- If a data freshness warning appears, note it in the analysis
- 运行分析脚本:
python3 scripts/analyze_sector_rotation.py - 从输出中提取以下信息:
- 按上涨趋势比率排序的行业排名
- 风险体系(周期型vs防御型)及得分
- 处于超买/超卖状态的行业
- 周期阶段估算结果及置信度
- 若出现数据新鲜度警告,需在分析中注明
Step 2: Market Cycle Assessment
步骤2:市场周期评估
Use the script's cycle phase estimate as a starting point:
- Read to access market cycle and sector rotation frameworks
references/sector_rotation.md - Compare the script's quantitative findings against expected patterns for each cycle phase:
- Early Cycle Recovery
- Mid Cycle Expansion
- Late Cycle
- Recession
- Add qualitative interpretation informed by the knowledge base
If chart images are provided, use them to supplement with industry-level detail:
- Extract industry-level performance data from chart images
- Compare 1-week vs 1-month performance for trend consistency
- Note specific industries showing strength or weakness within sectors
以脚本输出的周期阶段估算结果为起点:
- 阅读,获取市场周期与行业轮动框架
references/sector_rotation.md - 将脚本的定量分析结果与各周期阶段的预期模式进行对比:
- 早期周期复苏阶段
- 中期周期扩张阶段
- 后期周期阶段
- 衰退阶段
- 结合知识库添加定性解读
若提供了图表图片,可利用其补充行业层面的细节:
- 从图表图片中提取行业层面的表现数据
- 对比1周与1个月的表现,验证趋势一致性
- 记录各行业板块中表现强劲或疲软的细分行业
Step 3: Current Situation Analysis
步骤3:当前形势分析
Synthesize observations into an objective assessment:
- State which market cycle phase current performance most closely resembles
- Highlight supporting evidence (which sectors/industries confirm this view)
- Note any contradictory signals or unusual patterns
- Assess confidence level based on consistency of signals
Use data-driven language and specific references to performance figures.
将观察结果整合为客观评估:
- 说明当前表现最接近哪个市场周期阶段
- 突出支持性证据(哪些行业/细分行业印证了这一判断)
- 记录任何矛盾信号或异常模式
- 根据信号的一致性评估置信度
使用基于数据的表述方式,并明确引用表现数据。
Step 4: Scenario Development
步骤4:情景构建
Based on sector rotation principles and current positioning, develop 2-4 potential scenarios for the next phase:
For each scenario:
- Describe the market cycle transition
- Identify which sectors would likely outperform
- Identify which sectors would likely underperform
- Specify the catalysts or conditions that would confirm this scenario
- Assign a probability (see Probability Assessment Framework in sector_rotation.md)
Scenarios should range from most likely (highest probability) to alternative/contrarian scenarios.
基于行业轮动原则和当前定位,为下一阶段构建2-4种潜在情景:
每个情景需包含:
- 描述市场周期的过渡情况
- 指出可能表现领先的行业
- 指出可能表现落后的行业
- 明确可印证该情景的催化剂或条件
- 分配概率(详见sector_rotation.md中的概率评估框架)
情景应涵盖从最可能发生(概率最高)到备选/反向情景的范围。
Step 5: Output Generation
步骤5:输出生成
Create a structured Markdown document with the following sections:
Required Sections:
- Executive Summary: 2-3 sentence overview of key findings
- Current Situation: Detailed analysis of current performance patterns and market cycle positioning
- Supporting Evidence: Specific sector and industry performance data supporting the cycle assessment
- Scenario Analysis: 2-4 scenarios with descriptions and probability assignments
- Recommended Positioning: Strategic and tactical positioning recommendations based on scenario probabilities
- Key Risks: Notable risks or contradictory signals to monitor
创建包含以下章节的结构化Markdown文档:
必填章节:
- 执行摘要:用2-3句话概述关键发现
- 当前形势:对当前表现模式和市场周期定位的详细分析
- 支持证据:支持周期评估的具体行业及细分行业表现数据
- 情景分析:2-4种情景,包含描述及概率分配
- 推荐配置:基于情景概率的战略与战术配置建议
- 关键风险:需关注的显著风险或矛盾信号
Output Format
输出格式
Save analysis results as a Markdown file with naming convention:
sector_analysis_YYYY-MM-DD.mdUse this structure:
markdown
undefined将分析结果保存为Markdown文件,命名规则为:
sector_analysis_YYYY-MM-DD.md采用以下结构:
markdown
undefinedSector Performance Analysis - [Date]
Sector Performance Analysis - [Date]
Executive Summary
Executive Summary
[2-3 sentences summarizing key findings]
[2-3 sentences summarizing key findings]
Current Situation
Current Situation
Market Cycle Assessment
Market Cycle Assessment
[Which cycle phase and why]
[Which cycle phase and why]
Performance Patterns Observed
Performance Patterns Observed
1-Week Performance
1-Week Performance
[Analysis of recent performance]
[Analysis of recent performance]
1-Month Performance
1-Month Performance
[Analysis of medium-term trends]
[Analysis of medium-term trends]
Sector-Level Analysis
Sector-Level Analysis
[Detailed breakdown by sector]
[Detailed breakdown by sector]
Industry-Level Analysis
Industry-Level Analysis
[Notable industry-specific observations]
[Notable industry-specific observations]
Supporting Evidence
Supporting Evidence
Confirming Signals
Confirming Signals
- [List data points supporting cycle assessment]
- [List data points supporting cycle assessment]
Contradictory Signals
Contradictory Signals
- [List any conflicting indicators]
- [List any conflicting indicators]
Scenario Analysis
Scenario Analysis
Scenario 1: [Name] (Probability: XX%)
Scenario 1: [Name] (Probability: XX%)
Description: [What happens]
Outperformers: [Sectors/industries]
Underperformers: [Sectors/industries]
Catalysts: [What would confirm this scenario]
Description: [What happens]
Outperformers: [Sectors/industries]
Underperformers: [Sectors/industries]
Catalysts: [What would confirm this scenario]
Scenario 2: [Name] (Probability: XX%)
Scenario 2: [Name] (Probability: XX%)
[Repeat structure]
[Additional scenarios as appropriate]
[Repeat structure]
[Additional scenarios as appropriate]
Recommended Positioning
Recommended Positioning
Strategic Positioning (Medium-term)
Strategic Positioning (Medium-term)
[Sector allocation recommendations]
[Sector allocation recommendations]
Tactical Positioning (Short-term)
Tactical Positioning (Short-term)
[Specific adjustments or opportunities]
[Specific adjustments or opportunities]
Key Risks and Monitoring Points
Key Risks and Monitoring Points
[What to watch that could invalidate the analysis]
Analysis Date: [Date]
Data Period: [Timeframe of charts analyzed]
undefined[What to watch that could invalidate the analysis]
Analysis Date: [Date]
Data Period: [Timeframe of charts analyzed]
undefinedKey Analysis Principles
核心分析原则
When conducting analysis:
- Objectivity First: Let the data guide conclusions, not preconceptions
- Probabilistic Thinking: Express uncertainty through probability ranges
- Multiple Timeframes: Compare 1-week and 1-month data for trend confirmation
- Relative Performance: Focus on relative strength, not absolute returns
- Breadth Matters: Broad-based moves are more significant than isolated movements
- No Absolutes: Markets rarely follow textbook patterns exactly
- Historical Context: Reference typical rotation patterns but acknowledge uniqueness
进行分析时需遵循以下原则:
- 客观优先:让数据主导结论,而非先入为主的观念
- 概率思维:通过概率区间表达不确定性
- 多时间维度:对比1周和1个月的数据以验证趋势
- 相对表现:关注相对强弱,而非绝对收益
- 广度重要:广泛的板块变动比孤立的波动更具意义
- 无绝对规律:市场很少完全遵循教科书式的模式
- 历史背景:参考典型轮动模式,但需承认市场的独特性
Probability Guidelines
概率指引
Apply these probability ranges based on evidence strength:
- 70-85%: Strong evidence with multiple confirming signals across sectors and timeframes
- 50-70%: Moderate evidence with some confirming signals but mixed indicators
- 30-50%: Weak evidence with limited or conflicting signals
- 15-30%: Speculative scenario contrary to current indicators but possible
Total probabilities across all scenarios should sum to approximately 100%.
根据证据强度应用以下概率区间:
- 70-85%:证据充分,跨行业和时间维度存在多个印证信号
- 50-70%:证据中等,存在部分印证信号但指标混杂
- 30-50%:证据薄弱,信号有限或存在矛盾
- 15-30%:投机性情景,与当前指标相反但仍有可能发生
所有情景的概率总和应约为100%。
Resources
资源
scripts/
scripts/目录
- - Fetches sector CSV data and produces sector rankings, risk regime scoring, overbought/oversold flags, and cycle phase estimation. No API key required.
analyze_sector_rotation.py
- - 获取行业CSV数据,生成行业排名、风险体系得分、超买/超卖标记及周期阶段估算。无需API密钥。
analyze_sector_rotation.py
references/
references/目录
- - Comprehensive knowledge base covering market cycle phases, typical sector performance patterns, and probability assessment frameworks
sector_rotation.md
- - 涵盖市场周期阶段、典型行业表现模式及概率评估框架的综合知识库
sector_rotation.md
assets/
assets/目录
Sample charts demonstrating the expected input format for optional image-based analysis:
- - Example sector-level performance chart (1-week and 1-month)
sector_performance.jpeg - - Example industry performance chart (outperformers)
industory_performance_1.jpeg - - Example industry performance chart (underperformers)
industory_performance_2.jpeg
用于演示可选图片分析预期输入格式的示例图表:
- - 行业层面表现图表示例(1周和1个月)
sector_performance.jpeg - - 细分行业表现图表示例(领先者)
industory_performance_1.jpeg - - 细分行业表现图表示例(落后者)
industory_performance_2.jpeg
Important Notes
重要说明
- All analysis thinking should be conducted in English
- Output Markdown files must be in English
- Reference the sector rotation knowledge base for each analysis
- Maintain objectivity and avoid confirmation bias
- Update probability assessments if new data becomes available
- Chart images are optional; CSV data provides the primary analysis input
- The script uses the same sector classification as uptrend-analyzer for consistency
- 所有分析思考过程需以英文进行
- 输出的Markdown文件必须为英文
- 每次分析需参考行业轮动知识库
- 保持客观,避免确认偏差
- 若有新数据可用,需更新概率评估
- 图表图片为可选内容;CSV数据是主要分析输入
- 为保持一致性,脚本采用与uptrend-analyzer相同的行业分类