OPEN-SOURCE SCRIPT

10Y–2Y Treasury Yield Curve Spread & MES % Change

177
📝 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.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。