All skills
tradermonty avatar

/macro-regime-detector

@ea2f59c

Detect structural macro regime transitions (1-2 year horizon) using cross-asset ratio analysis. Analyze RSP/SPY concentration, yield curve, credit conditions, size factor, equity-bond relationship, and sector rotation to identify regime shifts between Concentration, Broadening, Contraction, Inflationary, and Transitional states. Run when user asks about macro regime, market regime change, structural rotation, or long-term market positioning.

Use this Skill: https://skilld.dev/gh/tradermonty/claude-trading-skills/macro-regime-detector

This session only. Nothing lands on disk.

referenceshistorical_regimes.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Historical Regime Examples

Reference cases for the 5 regime classifications. Use these to contextualize current readings and identify historical parallels.

Concentration Regimes

2023-2024: Magnificent Seven Dominance

  • RSP/SPY: Declined from ~0.32 to ~0.29, a multi-year low
  • IWM/SPY: Persistent underperformance of small-caps
  • Credit: Stable to easing (HYG/LQD steady)
  • Characteristics: Top 7 stocks drove ~60% of S&P 500 returns
  • Duration: ~18 months
  • Resolution: Early signs of broadening in late 2024 (RSP/SPY bottoming)
  • Portfolio posture: Mega-cap growth overweight was the only winning strategy

2019-2020 (Pre-COVID): FAANG+ Concentration

  • RSP/SPY: Gradual decline through 2019
  • IWM/SPY: Small-cap underperformance
  • Ended: Abruptly with COVID crash (exogenous shock)

Broadening Regimes

2003-2004: Post-Dot-Com Recovery

  • RSP/SPY: Rose significantly as value and small-caps recovered
  • IWM/SPY: Strong small-cap outperformance
  • Credit: HYG/LQD rising as credit conditions eased
  • Yield curve: Steep (accommodative Fed)
  • Duration: ~24 months
  • Portfolio posture: Small-cap value, equal-weight strategies outperformed

2016-2017: Post-Election Broadening

  • RSP/SPY: Rose as cyclicals and financials rallied
  • IWM/SPY: Small-cap surge post-election
  • Credit: Stable to improving
  • XLY/XLP: Strong cyclical outperformance
  • Duration: ~12 months
  • Portfolio posture: Cyclicals, financials, small-cap growth

Contraction Regimes

2007-2009: Global Financial Crisis

  • Credit: HYG/LQD collapsed (credit freeze)
  • XLY/XLP: Extreme defensive rotation
  • SPY/TLT: Sharp decline as bonds rallied
  • Yield curve: Initially inverted, then steepened dramatically
  • Duration: ~18 months (bear phase)
  • Portfolio posture: Cash, Treasuries, defensive sectors

2020 Q1: COVID Crash

  • Credit: HYG/LQD dropped sharply in March
  • XLY/XLP: Rapid defensive rotation
  • SPY/TLT: Crashed as equities sold off
  • Duration: ~6 weeks (shortest contraction on record)
  • Resolution: Massive fiscal/monetary response triggered V-shaped recovery
  • Lesson: Not all contractions are prolonged; policy response matters

Inflationary Regimes

2022: Inflation Shock

  • Stock-bond correlation: Turned positive (both fell together)
  • SPY/TLT: Both declined simultaneously
  • 10Y-2Y: Deep inversion (most inverted since 1980s)
  • Yield curve: Aggressive flattening then inversion
  • Duration: ~12 months
  • Portfolio posture: Energy, commodities, real assets, short-duration bonds
  • Key characteristic: Traditional 60/40 portfolio failed as bonds didn't hedge

1970s Stagflation (Historical Reference)

  • Stock-bond correlation: Persistently positive
  • Commodities: Outperformed financial assets
  • Duration: Extended (years)
  • Modern parallel: 2022 showed echoes but resolved faster

Transitional Regimes

2024 Q4 - 2025 Q1: Current Example

  • RSP/SPY: Near historical lows (~0.297) but showing early bottoming signs
  • IWM/SPY: Mixed signals, brief outperformance then reversal
  • Credit: Stable (HYG/LQD holding)
  • Yield curve: Normalizing from inversion
  • XLY/XLP: Choppy, no clear direction
  • Interpretation: Multiple indicators shifting but no clear new regime yet
  • Portfolio posture: Maintain diversification, gradual position adjustments

2018: Failed Broadening

  • RSP/SPY: Brief broadening attempt in early 2018
  • Credit: Tightened in Q4 2018 (HYG selloff)
  • Resolution: Fed pivot in early 2019 prevented full contraction
  • Lesson: Transitional periods can resolve in any direction

Regime Transition Patterns

Common Sequences

  1. Concentration → Broadening: Usually requires catalyst (Fed easing, fiscal stimulus, valuation compression in leaders)

  2. Broadening → Contraction: Credit tightening is the typical trigger. Watch HYG/LQD for early warning.

  3. Contraction → Broadening: Policy response (rate cuts, QE) → credit easing → small-cap recovery

  4. Any → Inflationary: Positive stock-bond correlation is the key signal. Can emerge from either broadening or contraction.

Transition Timing

  • Average regime duration: 12-24 months
  • Transition phase: Typically 3-6 months of ambiguous signals
  • Early signals appear 2-4 months before consensus recognition
  • MA crossovers (6M vs 12M) confirm after the fact but provide low false-positive rate

False Signals

  • 2018 Q1: Broadening signal reversed by Q4 (trade war + Fed tightening)
  • 2015: Multiple signals of contraction that never fully materialized
  • Lesson: Require 3+ months of sustained signals before high-conviction repositioning

Source: SKILL.md on GitHub

No alerts11d5 checks · Risk SAFE
  • Gen Agent Trust Hub11d

    The macro-regime-detector skill is a financial analysis tool that uses cross-asset ratio analysis to identify structural shifts in the market. It fetches data from reputable services like Financial Modeling Prep and Yahoo Finance. The skill follows security best practices, including API key redaction in error messages and the use of environment variables for configuration. No malicious code or security vulnerabilities were detected.

  • Socket11d

    No alerts

  • Snyk11d

    Risk: LOW · No issues

  • Runlayer6mo

    2/27 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at ea2f59c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated 2 months ago

README badge

README badge for tradermonty/claude-trading-skills/macro-regime-detector