Portfolio Manager
Regime Shifted to Contraction β Agent Moved to Defensive in 24 Hours
Key Takeaway
The macro regime detector caught an expansion-to-contraction shift three weeks early, and Hari moved the portfolio to defensive positioning before the drawdown hit.
The Problem
Macro regime shifts don't announce themselves. They don't ring a bell. What actually happens is a slow degradation β a few leading indicators roll over, then a few more, and by the time the financial press runs "Are We in a Recession?" headlines, you're already down 15%.
I've lived through enough cycles to know the pattern. The problem isn't knowledge β it's attention. When markets are going up, nobody wants to look at deteriorating PMIs or inverted yield curves. Confirmation bias is a hell of a drug.
My portfolio was running 30% equities. Concentrated in high-beta names β NVDA, TSLA, PLTR. These are the stocks that rip on the way up and destroy on the way down. In expansion, that's the right exposure. In contraction, it's a death sentence.
I needed a system that watched the macro regime continuously β not when I remembered to check, not when Twitter got bearish, but every single day, with no emotion and no bias.
The Solution
The Macro Regime Detector skill classifies the current economic environment into four states: expansion, slowdown, contraction, recovery. It ingests 18 macro indicators β PMI, ISM, yield curve, credit spreads, initial claims, consumer confidence, industrial production, and more.
Paired with the Portfolio Watcher, regime changes trigger automatic portfolio review and rebalancing recommendations from Hari.
The Process
The regime detector runs a hidden Markov model trained on 40 years of macro data:
yamlShow code
# macro-regime-config.yaml
indicators:
leading:
- ISM_manufacturing_PMI
- yield_curve_10y2y
- initial_claims_4wk_avg
- building_permits
- consumer_expectations
- leading_economic_index
coincident:
- nonfarm_payrolls
- industrial_production
- real_personal_income
- manufacturing_sales
lagging:
- CPI_yoy
- unemployment_rate
- prime_rate
- commercial_loans
regime_states:
expansion: { equity_target: "25-35%", risk: "full" }
slowdown: { equity_target: "15-25%", risk: "reduce_beta" }
contraction: { equity_target: "5-15%", risk: "defensive" }
recovery: { equity_target: "20-30%", risk: "increase_cyclicals" }
transition_alert:
confidence_threshold: 0.65
notify: telegram
action: generate_rebalance_recommendation
Here's what actually happened over three weeks:
View details
Week 1: Regime = Expansion (confidence: 0.72)
- ISM dropped below 50 for first time in 6 months
- Yield curve flattening accelerated
- Initial claims ticking up: 215K β 228K
- Detector: "Expansion β Slowdown transition probability: 45%"
Week 2: Regime = Slowdown (confidence: 0.61)
- Consumer confidence dropped 8 points
- Credit spreads widened 40bps
- Building permits down 12% MoM
- Detector: "Slowdown β Contraction transition probability: 58%"
Week 3: Regime = Contraction (confidence: 0.82)
- ISM at 47.2, services ISM at 48.8
- Initial claims: 248K (highest in 14 months)
- Industrial production negative
- Detector: "Contraction confirmed. Historical drawdown: -15% to -25%"
When contraction confidence hit 82%, Hari generated this recommendation:
jsonShow code
{
"action": "defensive_rebalance",
"current_allocation": {
"equities": "30%",
"bonds": "20%",
"crypto": "15%",
"cash": "25%",
"gold": "10%"
},
"recommended_allocation": {
"equities": "12%",
"bonds": "28%",
"crypto": "8%",
"cash": "35%",
"gold": "17%"
},
"rationale": "Contraction regime historically sees -15% to -25% equity drawdown. High-beta names (NVDA, TSLA, PLTR) typically fall 1.5-2x the index. Increasing gold and cash provides dry powder for recovery entry.",
"confidence": 0.82,
"requires_approval": true
}
I reviewed it. Approved the rebalance. Execution started within the hour.
The Results
~3 weeks before media consensus
Detection lead time
82%
Confidence at action
30% β 12%
Equity reduction
-4.2%
Portfolio drawdown (actual)
-14.8%
Benchmark drawdown (S&P 500)
~10.6% relative
Capital preserved vs. holding
Agent flagged recovery regime 6 weeks later
Recovery entry timing
24 hours (including my review)
Time from alert to rebalance
Was the timing perfect? No. I took some drawdown before the rebalance completed. And I could have been more aggressive on the gold allocation. But the direction was right. And direction matters more than precision.
The real win was the recovery detection. Six weeks later, the regime detector flagged a contraction β recovery transition at 68% confidence. I started rebuilding equity exposure before the bounce was obvious. That's the compounding advantage β it's not just about avoiding the drop, it's about catching the turn.
Try It Yourself
Install the Macro Regime Detector and Portfolio Watcher skills. The regime detector needs API access to FRED (free) for economic data. Configure your portfolio holdings and risk targets per regime. Start with alerts only β don't automate rebalancing until you trust the classifications.
The model needs about 2 weeks of daily data before confidence scores stabilize. Don't act on low-confidence readings. Wait for 65%+ before you take it seriously.
Markets are a mood. The agent reads the mood. I make the decisions.
Related case studies
Portfolio Manager
Sector Rotation Signal β Tech Lagging, Agent Says Move to Energy
AI agent detects sector momentum shifts and cross-references macro regime data to recommend sector rotation. How we spotted tech's lag 3 weeks before consensus.
Fund Manager
Portfolio VaR Report for the Board β Generated in 2 Minutes
AI agent generates institutional-grade VaR, CVaR, and Sharpe ratio reports across equities, crypto, and DeFi β formatted for board presentation in under 2 minutes.
Portfolio Manager
The Complete Financial Operating System β All 17 Skills in One Stack
How 17 AI finance skills work as one integrated system: data ingestion, analysis, execution, and reporting. 31 agents across 8 teams running a complete financial operating system on Mr.Chief.
Want results like these?
Start free with your own AI team. No credit card required.