Skip to main content

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:

RegimeWhat It MeansImpact on Trades
Risk-OnStocks up, VIX down, risk assets risingFavors LONG positions
Risk-OffStocks down, VIX up, flight to safetyFavors SHORT positions or caution
NeutralMixed signals, no clear directionNo strong bias either way
TransitioningConditions are changingHigher uncertainty

2. Cross-Asset Analysis

The agent compares your ticker to major indices:

IndexWhat It Tells Us
SPYBroad market direction (S&P 500)
QQQTech sector strength (NASDAQ-100)
VIXFear gauge (high = uncertainty)
DXYDollar 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:

StatusWhat It Means
LeadingTicker moves before market (potential early signal)
LaggingTicker moves after market (catching up)
In SyncTicker moves with market in real-time
DecoupledTicker ignores market direction (idiosyncratic)

4. Economic Assessment

FactorWhat We Check
Inflation TrendRising / Falling / Stable (based on CPI/PCE)
Fed StanceHawkish / Dovish / Neutral (implied from data)
Yield CurveNormal / 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 AgeWeight
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 AgeWeightLabel
<15 minutesHIGHEST (breaking catalyst)[BREAKING - JUST NOW]
<60 minutesHIGH (current context)[X min ago]
1-24 hoursMEDIUM (developing story)[Xh ago]
>24 hoursLOW (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:

SentimentMeaning
BullishNews flow is positive
BearishNews flow is negative
NeutralBalanced or no significant news
MixedConflicting news signals

6. Global Events & Wild Cards

The Macro Agent is aware of events that can override technical analysis:

Event TypeExamples
Fed commentsPowell speech = instant market reaction
Social mediaElon/Trump tweets can move specific stocks or crypto
GeopoliticalWar, trade disputes
Liquidity eventsJapanese yen carry trade unwinding
Currency crisesCan cause market-wide impact

7. International Markets

MarketWhat 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

SessionCharacteristics
Pre-marketOvernight news, gap risk
Regular hoursNormal trading conditions
After-hoursThin liquidity, news-driven moves

Direction Mapping

The Macro Agent's output maps to trading direction:

Macro OutputTrading Direction
risk_onBULLISH (same as LONG)
risk_offBEARISH (same as SHORT)
neutralNO 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:

FieldValuesDescription
market_regimerisk_on / risk_off / neutral / transitioningOverall market environment
confidence0-100Minimum 40% if ANY data exists
spy_directionup / down / flatS&P 500 direction
qqq_directionup / down / flatNASDAQ-100 direction
cross_asset_alignmentaligned / divergent / mixedTicker vs market
intermarket_divergenceleading / lagging / in_sync / decoupledTicker behavior vs market
session_contextobjectSession type and risk note
economic_assessmentobjectInflation, Fed stance, yield curve
news_sentimentobjectOverall sentiment + key themes
international_assessmentobjectAsia/Europe sentiment and gap bias
reasoningarraySpecific 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.