OPEN-SOURCE SCRIPT
NQ–2Y Correlation

This indicator tracks the relationship between the Nasdaq futures (NQ) and the US 2-Year Treasury yield (US02Y). The two typically move in opposite directions. This tool highlights when that relationship breaks down, and when moves become stretched to extremes. This can be useful for traders to find inflection points in price representing either overbought or oversold extremes.
Key Features
Residual Z-Score: Shows how far NQ’s returns deviate from what would be expected given moves in the 2Y. Useful for spotting stretched conditions (+/- 2σ bands).
Correlation Tracking: Fast and slow correlations between NQ and inverted 2Y returns. Helps identify regime shifts in the relationship.
Same-Direction Signals: Green dots mark when NQ and 2Y both move strongly in the same direction (rare alignment). Red dots mark strong opposing moves.
Alerts: Triggers available for residual stretches, correlation flips, and significant same-direction or opposite moves.
Usage
Monitor Z-Score to identify when the equity–rates linkage is stretched beyond typical bounds. I typically use this on the H1 or H4 timeframe.
Watch for correlation regime shifts to spot changing market dynamics. Typically price falling into support or moving into resistance as there is a false correlation or a flip.
Same-direction dots help flag unusual synchronized moves between risk assets and yields - these are especially useful for identifying false moves.
Key Features
Residual Z-Score: Shows how far NQ’s returns deviate from what would be expected given moves in the 2Y. Useful for spotting stretched conditions (+/- 2σ bands).
Correlation Tracking: Fast and slow correlations between NQ and inverted 2Y returns. Helps identify regime shifts in the relationship.
Same-Direction Signals: Green dots mark when NQ and 2Y both move strongly in the same direction (rare alignment). Red dots mark strong opposing moves.
Alerts: Triggers available for residual stretches, correlation flips, and significant same-direction or opposite moves.
Usage
Monitor Z-Score to identify when the equity–rates linkage is stretched beyond typical bounds. I typically use this on the H1 or H4 timeframe.
Watch for correlation regime shifts to spot changing market dynamics. Typically price falling into support or moving into resistance as there is a false correlation or a flip.
Same-direction dots help flag unusual synchronized moves between risk assets and yields - these are especially useful for identifying false moves.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。