Macro Return ForecastWhen the macro environment was similar, what annualized return did the market usually deliver next?
Before using the indicator, make sure your chart is set to any US-market symbol (SPX, QQQ, DIA, etc.).
This requirement is simple: the indicator pulls macro series from US data (yields, TIPS, credit spreads, breadth of US indices).
Because these series are independent from the chart’s price series, the chart symbol itself does not affect the internal calculations.
Any US symbol works, and the output of the model will be identical as long as you are on a US asset with daily, weekly or monthly timeframe.
The plotted price does not matter: the macro engine is fully exogenous to the chart symbol.
1. What the indicator does relative to selected assets
In the settings you choose which market you want to analyze:
- S&P500
- Nasdaq or NQ100
- Dow Jones
- Russell 2000
- US-wide (VTI)
- S&P500 sectors (XLF, XLY, XLP, etc.)
For each one, the indicator loads:
- Its internal breadth series (percentage of constituents above MA200)
- Its price history to compute forward log-returns at multiple horizons
- Its regime position relative to its own MA200 (for bull/bear filtering)
This means the tool is not tied to the chart symbol you display.
If your chart is SPX but the indicator setting is “S&P500 Technology”, the expected return projection is computed for the Technology sector using its own data, not the chart’s data.
You can therefore:
- Visualize macro-driven expected returns for any major US index or sector.
- Compare how different parts of the market historically reacted to similar macro states.
- Switch assets instantly to see which segment historically behaved better in comparable macro conditions.
The indicator becomes an analyzer of macro sensitivity, not a chart-dependent indicator.
2. Method overview
The model answers a statistical question:
“When macro conditions looked like they do today, what forward annualized return did this asset usually deliver?”
To do this it combines four macro pillars:
- Market breadth of the selected asset
- Yield curve slope (US 10Y minus 2Y)
- US credit spread (high yield minus gov)
- US real rate (TIPS 10Y)
It normalizes each metric into a 0–100 score, groups similar historical states into bins, and examines what the asset did next across six horizons (from ~9 months to ~5 years).
This produces a historical map connecting macro states to realized forward returns.
It is not a forecast model.
It is a conditional-distribution estimator: it tells you what has historically happened from similar setups.
3. Why this produces useful insights on assets
For any chosen asset (SPX, Nasdaq, sectors…), the indicator computes:
- Its forward return distribution in similar macro states.
- How often these states occurred (n).
- Whether the macro environment that preceded positive returns in the past resembles today’s.
- Whether the asset tends to be more sensitive or more resilient than the broad index under given macro configurations.
- Whether a given sector historically benefited from specific yield-curve, credit or real-rate environments.
This lets you answer questions such as:
- Does this sector usually outperform in an inverted yield curve environment?
- Does the Nasdaq historically recover strongly after breadth collapses?
- How did the S&P500 behave historically when real rates were this high?
- Is today’s credit-spread environment typically associated with positive or negative forward returns for this index?
These insights are not predictions but statistical context backed by past market behavior.
4. Why the technique is robust (and why it matters)
The engine uses strict, non-optimistic data processing:
- Winsorization of returns to neutralize extreme outliers without deleting information.
- Shrinkage estimators to avoid overfitting when bins contain few occurrences.
- Adaptive or static bounds for scaling macro indicators, ensuring comparability across cycles.
- Inverse-variance weighting of horizons with penalties for horizon redundancy.
- HAC-style adjustments to reduce autocorrelation bias in return estimation.
Each method aims to prevent artificial inflation of expected-return values and to keep the estimator stable even in unusual macro states.
This produces a result that is not “optimistic”, not curve-fit, not dependent on chart tricks, and not sensitive to isolated historical anomalies.
5. What you get as a user
A single clean line:
Expected Annual Return (%)
This line reflects how the chosen asset historically performed after macro environments similar to today’s.
The color gradient and confidence indicator (n) show the density of comparable episodes in history.
This makes the output extremely simple to read:
- High, stable expectation: historically supportive macro environment.
- Low or negative expectation: historically weaker environments.
- Low confidence: the macro state is rare and historical comparisons are limited.
The tool therefore adds context, not signals.
It helps you understand the environment the asset is currently in, based on how markets behaved in similar conditions across US market history.
Creditspread
Credit Spread Monitor: HY & IG vs US10Y📉 Credit Spread Monitor: HY & IG vs US10Y
This indicator provides a dynamic and visual way to monitor credit spreads relative to the US Treasury benchmark. By comparing High Yield (HY) and Investment Grade (IG) corporate bond yields to the 10-Year US Treasury Yield (US10Y), it helps assess market stress, investor risk appetite, and potential macro turning points.
🔍 What It Does
-Calculates credit spreads:
HY Spread = BAMLH0A0HYM2EY − US10Y
IG Spread = BAMLC0A0CMEY − US10Y
-Detects macro risk regimes using statistical thresholds and yield curve signals:
🔴 HY Spread > +2σ → Potential financial stress
🟠 Inverted Yield Curve + HY Spread > 2% → Recession risk
🟢 HY Spread < 1.5% → Risk-on environment
-Visually highlights conditions with intuitive background colors for fast decision-making.
📊 Data Sources Explained
🔴 High Yield (HY): BAMLH0A0HYM2EY → ICE BofA US High Yield Index Effective Yield
🔵 Investment Grade (IG): BAMLC0A0CMEY → ICE BofA US Corporate Index Effective Yield
⚪ Treasury 10Y: US10Y → 10-Year US Treasury Yield
⚪ Treasury 2Y: US02Y → 2-Year US Treasury Yield (used to detect curve inversion)
✅ This Indicator Is Ideal For:
Macro traders looking to anticipate economic inflection points
Portfolio managers monitoring systemic risk or credit cycles
Fixed-income analysts tracking the cost of corporate borrowing
ETF/Asset allocators identifying shifts between risk-on and risk-off environments
🧠 Why It's Useful
This script helps visualize how tight or loose credit conditions are relative to government benchmarks. Since HY spreads typically widen before major downturns, this tool can provide early warning signals. Similarly, compressed spreads may indicate overheating or complacency in risk markets.
🛠️ Practical Use Case:
You’re managing a multi-asset portfolio. The HY spread jumps above +2σ while the yield curve remains inverted. You decide to reduce exposure to equities and high-yield bonds and rotate into cash or Treasuries as recession risk rises.
📎 Additional Notes
Sourced from FRED (Federal Reserve Economic Data) and TradingView’s bond feeds.
Designed to work best on daily resolution, using open prices to ensure consistency across series with different update timings.
This script is original, not based on built-in or public templates, and intended to offer educational, statistical, and visual insights for serious market participants.
Triad Macro Gauge__________________________________________________________________________________
Introduction
__________________________________________________________________________________
The Triad Macro Gauge (TMG) is designed to provide traders with a comprehensive view of the macroeconomic environment impacting financial markets. By synthesizing three critical market signals— VIX (volatility) , Credit Spreads (credit risk) , and the Stocks/Bonds Ratio (SPY/TLT) —this indicator offers a probabilistic assessment of market sentiment, helping traders identify bullish or bearish macro conditions.
Holistic Macro Analysis: Combines three distinct macroeconomic indicators for multi-dimensional insights.
Customization & Flexibility: Adjust weights, thresholds, lookback periods, and visualization styles.
Visual Clarity: Dynamic table, color-coded plots, and anomaly markers for quick interpretation.
Fully Consistent Scores: Identical values across all timeframes (4H, daily, weekly).
Actionable Signals: Clear bull/bear thresholds and volatility spike detection.
Optimized for timeframes ranging from 4 hour to 1 week , the TMG equips swing traders and long-term investors with a robust tool to navigate macroeconomic trends.
__________________________________________________________________________________
Key Indicators
__________________________________________________________________________________
VIX (CBOE:VIX): Measures market volatility (negatively weighted for bearish signals).
Credit Spreads (FRED:BAMLH0A0HYM2EY): Tracks high-yield bond spreads (negatively weighted).
Stocks/Bonds Ratio (SPY/TLT): Evaluates equity sentiment relative to treasuries (positively weighted).
__________________________________________________________________________________
Originality and Purpose
__________________________________________________________________________________
The TMG stands out by combining VIX, Credit Spreads, and SPY/TLT into a single, cohesive indicator. Its unique strength lies in its fully consistent scores across all timeframes, a critical feature for multi-timeframe analysis.
Purpose: To empower traders with a clear, actionable tool to:
Assess macro conditions
Spot market extremes
Anticipate reversals
__________________________________________________________________________________
How It Works
__________________________________________________________________________________
VIX Z-Score: Measures volatility deviations (inverted for bearish signals).
Credit Z-Score: Tracks credit spread deviations (inverted for bearish signals).
Ratio Z-Score: Assesses SPY/TLT strength (positively weighted for bullish signals).
TMG Score: Weighted composite of z-scores (bullish > +0.30, bearish < -0.30).
Anomaly Detection: Identifies extreme volatility spikes (z-score > 3.0).
All calculations are performed using daily data, ensuring that scores remain consistent across all chart timeframes.
__________________________________________________________________________________
Visualization & Interpretation
__________________________________________________________________________________
The script visualizes data through:
A dynamic table displaying TMG Score , VIX Z, Credit Z, Ratio Z, and Anomaly status, with color gradients (green for positive, red for negative, gray for neutral/N/A).
A plotted TMG Score in Area, Histogram, or Line mode , with adaptive opacity for clarity.
Bull/Bear thresholds as horizontal lines (+0.30/-0.30) to signal market conditions.
Anomaly markers (orange circles) for volatility spikes.
Crossover signals (triangles) for bull/bear threshold crossings.
The table provides an immediate snapshot of macro conditions, while the plot offers a visual trend analysis. All values are consistent across timeframes, simplifying multi-timeframe analysis.
__________________________________________________________________________________
Script Parameters
__________________________________________________________________________________
Extensive customization options:
Symbol Selection: Customize VIX, Credit Spreads, SPY, TLT symbols
Core Parameters: Adjust lookback periods, weights, smoothing
Anomaly Detection: Enable/disable with custom thresholds
Visual Style: Choose display modes and colors
__________________________________________________________________________________
Conclusion
__________________________________________________________________________________
The Triad Macro Gauge by Ox_kali is a cutting-edge tool for analyzing macroeconomic trends. By integrating VIX, Credit Spreads, and SPY/TLT, TMG provides traders with a clear, consistent, and actionable gauge of market sentiment.
Recommended for: Swing traders and long-term investors seeking to navigate macro-driven markets.
__________________________________________________________________________________
Credit & Inspiration
__________________________________________________________________________________
Special thanks to Caleb Franzen for his pioneering work on macroeconomic indicator blends – his research directly inspired the core framework of this tool.
__________________________________________________________________________________
Notes & Disclaimer
__________________________________________________________________________________
This is the initial public release (v2.5.9). Future updates may include additional features based on user feedback.
Please note that the Triad Macro Gauge is not a guarantee of future market performance and should be used with proper risk management. Past performance is not indicative of future results.
Liquidity Stress Index SOFR - IORBLiquidity Stress Index (SOFR - IORB)
This indicator tracks the spread between the Secured Overnight Financing Rate (SOFR) and the Interest on Reserve Balances (IORB) set by the Federal Reserve.
A persistently positive spread may indicate funding stress or liquidity shortages in the repo market, as it suggests overnight lending rates exceed the risk-free rate banks earn at the Fed.
Useful for monitoring monetary policy transmission or market/liquidity stress.



