OPEN-SOURCE SCRIPT
10Y–2Y Treasury Yield Curve Spread & MES % Change

📝 Description:
This indicator tracks the U.S. 10-Year minus 2-Year Treasury yield spread — a powerful macroeconomic signal often used by professional traders to gauge market sentiment and recession risk — and overlays an optional MES % change line to help intraday futures traders spot macro–price divergences in real time.
Features:
🏦 Plots the 10Y–2Y spread, with optional EMA smoothing.
📉 Highlights yield curve inversion (background turns red when spread < 0).
📊 Optional MES % change line from daily or RTH open for directional bias.
🔔 Alert conditions for:
Yield curve inversion / un-inversion.
Sudden spread spikes in basis points (customizable).
🧮 Optional correlation plot to visualize relationship strength between MES and the yield curve.
🧭 Z-score normalization allows both series to be viewed in one pane without scaling issues.
Why it matters:
A falling or inverted 2s10s spread often signals risk-off behavior and pressure on equities.
A steepening curve tends to support risk-on rallies.
Divergences between MES price action and the spread can provide early warning signals of reversals or fakeouts.
Best used with:
MES (MES1!) or MYM charts for intraday & swing bias.
Fed event days, CPI/NFP, or any macro-sensitive sessions.
VWAP or structure-based intraday trading strategies.
⚠️ Note: This indicator is for informational purposes only and does not constitute financial advice. Always combine macro context with your own trade plan and risk management.
This indicator tracks the U.S. 10-Year minus 2-Year Treasury yield spread — a powerful macroeconomic signal often used by professional traders to gauge market sentiment and recession risk — and overlays an optional MES % change line to help intraday futures traders spot macro–price divergences in real time.
Features:
🏦 Plots the 10Y–2Y spread, with optional EMA smoothing.
📉 Highlights yield curve inversion (background turns red when spread < 0).
📊 Optional MES % change line from daily or RTH open for directional bias.
🔔 Alert conditions for:
Yield curve inversion / un-inversion.
Sudden spread spikes in basis points (customizable).
🧮 Optional correlation plot to visualize relationship strength between MES and the yield curve.
🧭 Z-score normalization allows both series to be viewed in one pane without scaling issues.
Why it matters:
A falling or inverted 2s10s spread often signals risk-off behavior and pressure on equities.
A steepening curve tends to support risk-on rallies.
Divergences between MES price action and the spread can provide early warning signals of reversals or fakeouts.
Best used with:
MES (MES1!) or MYM charts for intraday & swing bias.
Fed event days, CPI/NFP, or any macro-sensitive sessions.
VWAP or structure-based intraday trading strategies.
⚠️ Note: This indicator is for informational purposes only and does not constitute financial advice. Always combine macro context with your own trade plan and risk management.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.