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.
Load reference documents for methodology context:
references/regime_detection_methodology.mdreferences/indicator_interpretation_guide.mdExecute 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).
Read the generated Markdown report and present findings to user.
Provide additional context using references/historical_regimes.md when user asks about historical parallels.
FMP_API_KEY environment variable or pass --api-key#ComponentRatio/DataWeightWhat It Detects1Market ConcentrationRSP/SPY25%Mega-cap concentration vs market broadening2Yield Curve10Y-2Y spread20%Interest rate cycle transitions3Credit ConditionsHYG/LQD15%Credit cycle risk appetite4Size FactorIWM/SPY15%Small vs large cap rotation5Equity-BondSPY/TLT + correlation15%Stock-bond relationship regime6Sector RotationXLY/XLP10%Cyclical vs defensive appetite
macro_regime_YYYY-MM-DD_HHMMSS.json — Structured data for programmatic use
macro_regime_YYYY-MM-DD_HHMMSS.md — Human-readable report with:
AspectMacro Regime DetectorMarket Top DetectorMarket Breadth AnalyzerTime Horizon1-2 years (structural)2-8 weeks (tactical)Current snapshotData GranularityMonthly (6M/12M SMA)Daily (25 business days)Daily CSVDetection TargetRegime transitions10-20% correctionsBreadth health scoreAPI Calls10330 (Free CSV)
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)