macro-regime-detector

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Macro Regime Detector

宏观市场状态检测器

Detect structural macro regime transitions using monthly-frequency cross-asset ratio analysis. This skill identifies 1-2 year regime shifts that inform strategic portfolio positioning.
通过月度频率的跨资产比率分析检测结构性宏观市场状态转换。本工具可识别1-2年周期的状态转换,为战略性投资组合配置提供依据。

When to Use

使用场景

  • User asks about current macro regime or regime transitions
  • User wants to understand structural market rotations (concentration vs broadening)
  • User asks about long-term positioning based on yield curve, credit, or cross-asset signals
  • User references RSP/SPY ratio, IWM/SPY, HYG/LQD, or other cross-asset ratios
  • User wants to assess whether a regime change is underway
  • 用户询问当前宏观市场状态或状态转换情况
  • 用户希望了解结构性市场轮动(集中vs扩张)
  • 用户基于收益率曲线、信贷或跨资产信号询问长期配置策略
  • 用户提及RSP/SPY比率、IWM/SPY、HYG/LQD或其他跨资产比率
  • 用户希望评估是否正在发生市场状态变化

Workflow

工作流程

  1. Load reference documents for methodology context:
    • references/regime_detection_methodology.md
    • references/indicator_interpretation_guide.md
  2. Execute the main analysis script:
    bash
    python3 skills/macro-regime-detector/scripts/macro_regime_detector.py
    This fetches 600 days of data for 9 ETFs + Treasury rates (10 API calls total).
  3. Read the generated Markdown report and present findings to user.
  4. Provide additional context using
    references/historical_regimes.md
    when user asks about historical parallels.
  1. 加载方法论相关的参考文档:
    • references/regime_detection_methodology.md
    • references/indicator_interpretation_guide.md
  2. 执行主分析脚本:
    bash
    python3 skills/macro-regime-detector/scripts/macro_regime_detector.py
    该脚本会获取9只ETF+国债利率的600天数据(共10次API调用)。
  3. 读取生成的Markdown报告并向用户展示结果。
  4. 当用户询问历史相似情况时,使用
    references/historical_regimes.md
    提供额外背景信息。

Prerequisites

前置条件

  • FMP API Key (required): Set
    FMP_API_KEY
    environment variable or pass
    --api-key
  • Free tier (250 calls/day) is sufficient (script uses ~10 calls)
  • FMP API Key(必填):设置
    FMP_API_KEY
    环境变量或通过
    --api-key
    参数传入
  • 免费 tier(每日250次调用)已足够(脚本约使用10次调用)

6 Components

6大核心组件

#ComponentRatio/DataWeightWhat It Detects
1Market ConcentrationRSP/SPY25%Mega-cap concentration vs market broadening
2Yield Curve10Y-2Y spread20%Interest rate cycle transitions
3Credit ConditionsHYG/LQD15%Credit cycle risk appetite
4Size FactorIWM/SPY15%Small vs large cap rotation
5Equity-BondSPY/TLT + correlation15%Stock-bond relationship regime
6Sector RotationXLY/XLP10%Cyclical vs defensive appetite
序号组件比率/数据权重检测内容
1市场集中度RSP/SPY25%大盘股集中vs市场扩张
2收益率曲线10Y-2Y利差20%利率周期转换
3信贷环境HYG/LQD15%信贷周期风险偏好
4规模因子IWM/SPY15%小盘股vs大盘股轮动
5股债关系SPY/TLT + 相关性15%股债关系状态
6行业轮动XLY/XLP10%周期vs防御板块偏好

5 Regime Classifications

5种市场状态分类

  • Concentration: Mega-cap leadership, narrow market
  • Broadening: Expanding participation, small-cap/value rotation
  • Contraction: Credit tightening, defensive rotation, risk-off
  • Inflationary: Positive stock-bond correlation, traditional hedging fails
  • Transitional: Multiple signals but unclear pattern
  • Concentration(集中状态):大盘股领涨,市场行情狭窄
  • Broadening(扩张状态):市场参与度提升,小盘股/价值股轮动
  • Contraction(收缩状态):信贷收紧,防御板块轮动,风险规避
  • Inflationary(通胀状态):股债正相关,传统对冲失效
  • Transitional(过渡状态):多信号但模式不清晰

Output

输出结果

  • macro_regime_YYYY-MM-DD_HHMMSS.json
    — Structured data for programmatic use
  • macro_regime_YYYY-MM-DD_HHMMSS.md
    — Human-readable report with:
    1. Current Regime Assessment
    2. Transition Signal Dashboard
    3. Component Details
    4. Regime Classification Evidence
    5. Portfolio Posture Recommendations
  • macro_regime_YYYY-MM-DD_HHMMSS.json
    — 供程序化使用的结构化数据
  • macro_regime_YYYY-MM-DD_HHMMSS.md
    — 面向人类阅读的报告,包含:
    1. 当前市场状态评估
    2. 转换信号仪表盘
    3. 组件详情
    4. 状态分类依据
    5. 投资组合配置建议

Relationship to Other Skills

与其他工具的关系

AspectMacro Regime DetectorMarket Top DetectorMarket Breadth Analyzer
Time Horizon1-2 years (structural)2-8 weeks (tactical)Current snapshot
Data GranularityMonthly (6M/12M SMA)Daily (25 business days)Daily CSV
Detection TargetRegime transitions10-20% correctionsBreadth health score
API Calls~10~330 (Free CSV)
维度Macro Regime DetectorMarket Top DetectorMarket Breadth Analyzer
时间周期1-2年(结构性)2-8周(战术性)当前快照
数据粒度月度(6M/12M SMA)每日(25个交易日)每日CSV
检测目标状态转换10-20%回调市场广度健康评分
API调用次数~10~330(免费CSV)

Script Arguments

脚本参数

bash
python3 macro_regime_detector.py [options]

Options:
  --api-key KEY       FMP API key (default: $FMP_API_KEY)
  --output-dir DIR    Output directory (default: current directory)
  --days N            Days of history to fetch (default: 600)
bash
python3 macro_regime_detector.py [options]

Options:
  --api-key KEY       FMP API key (default: $FMP_API_KEY)
  --output-dir DIR    输出目录(默认:当前目录)
  --days N            要获取的历史数据天数(默认:600)