macro-regime-detector
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMacro 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
工作流程
-
Load reference documents for methodology context:
references/regime_detection_methodology.mdreferences/indicator_interpretation_guide.md
-
Execute the main analysis script:bash
python3 skills/macro-regime-detector/scripts/macro_regime_detector.pyThis fetches 600 days of data for 9 ETFs + Treasury rates (10 API calls total). -
Read the generated Markdown report and present findings to user.
-
Provide additional context usingwhen user asks about historical parallels.
references/historical_regimes.md
-
加载方法论相关的参考文档:
references/regime_detection_methodology.mdreferences/indicator_interpretation_guide.md
-
执行主分析脚本:bash
python3 skills/macro-regime-detector/scripts/macro_regime_detector.py该脚本会获取9只ETF+国债利率的600天数据(共10次API调用)。 -
读取生成的Markdown报告并向用户展示结果。
-
当用户询问历史相似情况时,使用提供额外背景信息。
references/historical_regimes.md
Prerequisites
前置条件
- FMP API Key (required): Set environment variable or pass
FMP_API_KEY--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大核心组件
| # | Component | Ratio/Data | Weight | What It Detects |
|---|---|---|---|---|
| 1 | Market Concentration | RSP/SPY | 25% | Mega-cap concentration vs market broadening |
| 2 | Yield Curve | 10Y-2Y spread | 20% | Interest rate cycle transitions |
| 3 | Credit Conditions | HYG/LQD | 15% | Credit cycle risk appetite |
| 4 | Size Factor | IWM/SPY | 15% | Small vs large cap rotation |
| 5 | Equity-Bond | SPY/TLT + correlation | 15% | Stock-bond relationship regime |
| 6 | Sector Rotation | XLY/XLP | 10% | Cyclical vs defensive appetite |
| 序号 | 组件 | 比率/数据 | 权重 | 检测内容 |
|---|---|---|---|---|
| 1 | 市场集中度 | RSP/SPY | 25% | 大盘股集中vs市场扩张 |
| 2 | 收益率曲线 | 10Y-2Y利差 | 20% | 利率周期转换 |
| 3 | 信贷环境 | HYG/LQD | 15% | 信贷周期风险偏好 |
| 4 | 规模因子 | IWM/SPY | 15% | 小盘股vs大盘股轮动 |
| 5 | 股债关系 | SPY/TLT + 相关性 | 15% | 股债关系状态 |
| 6 | 行业轮动 | XLY/XLP | 10% | 周期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
输出结果
- — Structured data for programmatic use
macro_regime_YYYY-MM-DD_HHMMSS.json - — Human-readable report with:
macro_regime_YYYY-MM-DD_HHMMSS.md- Current Regime Assessment
- Transition Signal Dashboard
- Component Details
- Regime Classification Evidence
- Portfolio Posture Recommendations
- — 供程序化使用的结构化数据
macro_regime_YYYY-MM-DD_HHMMSS.json - — 面向人类阅读的报告,包含:
macro_regime_YYYY-MM-DD_HHMMSS.md- 当前市场状态评估
- 转换信号仪表盘
- 组件详情
- 状态分类依据
- 投资组合配置建议
Relationship to Other Skills
与其他工具的关系
| Aspect | Macro Regime Detector | Market Top Detector | Market Breadth Analyzer |
|---|---|---|---|
| Time Horizon | 1-2 years (structural) | 2-8 weeks (tactical) | Current snapshot |
| Data Granularity | Monthly (6M/12M SMA) | Daily (25 business days) | Daily CSV |
| Detection Target | Regime transitions | 10-20% corrections | Breadth health score |
| API Calls | ~10 | ~33 | 0 (Free CSV) |
| 维度 | Macro Regime Detector | Market Top Detector | Market Breadth Analyzer |
|---|---|---|---|
| 时间周期 | 1-2年(结构性) | 2-8周(战术性) | 当前快照 |
| 数据粒度 | 月度(6M/12M SMA) | 每日(25个交易日) | 每日CSV |
| 检测目标 | 状态转换 | 10-20%回调 | 市场广度健康评分 |
| API调用次数 | ~10 | ~33 | 0(免费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)