Macro Agent
Status: Verified against code Last Updated: 2025-12-11
Role in Plain English
The Macro Agent is your big picture analyst. It steps back from the chart to answer:
"What's happening in the broader market, and does it support or challenge this trade?"
What It Analyzes
1. Market Regime Identification
The agent classifies the current market environment:
| Regime | What It Means | Impact on Trades |
|---|---|---|
| Risk-On | Stocks up, VIX down, risk assets rising | Favors LONG positions |
| Risk-Off | Stocks down, VIX up, flight to safety | Favors SHORT positions or caution |
| Neutral | Mixed signals, no clear direction | No strong bias either way |
| Transitioning | Conditions are changing | Higher uncertainty |
2. Cross-Asset Analysis
The agent compares your ticker to major indices:
| Index | What It Tells Us |
|---|---|
| SPY | Broad market direction (S&P 500) |
| QQQ | Tech sector strength (NASDAQ-100) |
| VIX | Fear gauge (high = uncertainty) |
| DXY | Dollar Index (currency strength impact, if available) |
Cross-Asset Alignment:
- Aligned: Your ticker moving WITH the market
- Divergent: Your ticker moving AGAINST the market
- Mixed: Some alignment, some divergence
3. Intermarket Divergence
The agent assesses whether the ticker is leading or lagging the broader market:
| Status | What It Means |
|---|---|
| Leading | Ticker moves before market (potential early signal) |
| Lagging | Ticker moves after market (catching up) |
| In Sync | Ticker moves with market in real-time |
| Decoupled | Ticker ignores market direction (idiosyncratic) |
4. Economic Assessment
| Factor | What We Check |
|---|---|
| Inflation Trend | Rising / Falling / Stable (based on CPI/PCE) |
| Fed Stance | Hawkish / Dovish / Neutral (implied from data) |
| Yield Curve | Normal / Inverted / Flat (2Y vs 10Y) |
Impact:
- Rising inflation + Hawkish Fed = Pressure on growth stocks
- Inverted yield curve = Recession signal = Risk-off bias
Economic Data Temporal Context
The Macro Agent applies temporal weighting to economic data:
| Data Age | Weight |
|---|---|
| Fresh (last few days) | HIGH weight, reliable |
| Recent (1-2 weeks) | MEDIUM weight |
| Stale (2+ weeks) | LOW weight, may be outdated |
Practical rule: If a key datapoint is stale, the Macro Agent flags it and reduces how much it influences the verdict.
5. News Sentiment (Temporal Weighting)
The agent reviews recent news and classifies overall sentiment with time-based weighting:
| News Age | Weight | Label |
|---|---|---|
| <15 minutes | HIGHEST (breaking catalyst) | [BREAKING - JUST NOW] |
| <60 minutes | HIGH (current context) | [X min ago] |
| 1-24 hours | MEDIUM (developing story) | [Xh ago] |
| >24 hours | LOW (background context) | [OLD] |
Practical rule: Breaking items (minutes old) matter most; older stories become background context unless they’re still actively moving price.
Sentiment Categories:
| Sentiment | Meaning |
|---|---|
| Bullish | News flow is positive |
| Bearish | News flow is negative |
| Neutral | Balanced or no significant news |
| Mixed | Conflicting news signals |
6. Global Events & Wild Cards
The Macro Agent is aware of events that can override technical analysis:
| Event Type | Examples |
|---|---|
| Fed comments | Powell speech = instant market reaction |
| Social media | Elon/Trump tweets can move specific stocks or crypto |
| Geopolitical | War, trade disputes |
| Liquidity events | Japanese yen carry trade unwinding |
| Currency crises | Can cause market-wide impact |
7. International Markets
| Market | What It Tells Us |
|---|---|
| Asia (Nikkei, Hang Seng) | Overnight sentiment |
| Europe (DAX, FTSE) | Current global risk appetite |
How We Use It:
- Asia strong + Europe strong = Bullish gap potential at US open
- Asia weak + Europe weak = Bearish gap potential
- Mixed = Uncertain opening, watch first 15 minutes
Note: International data weight decreases as the US session progresses.
8. Session Context
| Session | Characteristics |
|---|---|
| Pre-market | Overnight news, gap risk |
| Regular hours | Normal trading conditions |
| After-hours | Thin liquidity, news-driven moves |
Direction Mapping
The Macro Agent's output maps to trading direction:
| Macro Output | Trading Direction |
|---|---|
| risk_on | BULLISH (same as LONG) |
| risk_off | BEARISH (same as SHORT) |
| neutral | NO STRONG OPINION (doesn't block trades) |
Key Point: Macro "neutral" does NOT block trades. It just means the macro environment isn't providing strong directional bias.
What It Outputs
The Macro Agent returns a JSON verdict with these fields:
| Field | Values | Description |
|---|---|---|
market_regime | risk_on / risk_off / neutral / transitioning | Overall market environment |
confidence | 0-100 | Minimum 40% if ANY data exists |
spy_direction | up / down / flat | S&P 500 direction |
qqq_direction | up / down / flat | NASDAQ-100 direction |
cross_asset_alignment | aligned / divergent / mixed | Ticker vs market |
intermarket_divergence | leading / lagging / in_sync / decoupled | Ticker behavior vs market |
session_context | object | Session type and risk note |
economic_assessment | object | Inflation, Fed stance, yield curve |
news_sentiment | object | Overall sentiment + key themes |
international_assessment | object | Asia/Europe sentiment and gap bias |
reasoning | array | Specific observations with evidence |
Economic Assessment Object
"economic_assessment": {
"inflation_trend": "rising" | "falling" | "stable" | "unknown",
"fed_stance_implied": "hawkish" | "dovish" | "neutral" | "unknown",
"yield_curve_signal": "normal" | "inverted" | "flat" | "unknown",
"macro_headwinds": ["list of economic concerns"],
"macro_tailwinds": ["list of economic supports"]
}
International Assessment Object
"international_assessment": {
"asia_sentiment": "bullish" | "bearish" | "neutral" | "unavailable",
"europe_sentiment": "bullish" | "bearish" | "neutral" | "unavailable",
"gap_bias": "gap_up" | "gap_down" | "flat" | "uncertain",
"relevance": "high" | "medium" | "low" | "none"
}
News Sentiment Object
"news_sentiment": {
"overall": "bullish" | "bearish" | "neutral" | "mixed",
"key_themes": ["theme 1", "theme 2"],
"major_concerns": ["concern 1", "concern 2"]
}
Minimum Confidence Rule
- If you have SOME data, provide at least 40% confidence
- Only use 0% confidence if you have NO data at all
- Partial data = partial confidence
How Its Opinion Gets Used
The Macro Agent's verdict goes to the Supervisor Agent along with Technical and Wild Card verdicts.
Key rule: If Technical and Macro disagree, Technical wins because it has actual price data. Macro provides context, but price is truth.
Implementation details are intentionally omitted from public documentation.