OPEN-SOURCE SCRIPT
Macro Stress Monitor (USDJPY + JGB + Yield Curve)

# **Note‑Style Description**
This indicator provides a consolidated framework for monitoring two of the most systemically important channels of global USD liquidity transmission: **offshore USD funding conditions in Japan** and **front‑end U.S. rates stress linked to repo and collateral dynamics**. While TradingView does not supply direct access to cross‑currency basis swaps or repo benchmarks, the script employs market‑validated proxies that closely track the same underlying pressures observed in dealer balance‑sheet constraints, FX‑hedged flows, and Treasury funding markets.
### **1. USD/JPY Funding Pressure (Basis‑Swap Proxy)**
The USD/JPY cross‑currency basis is a primary indicator of offshore USD funding premia for Japanese banks, insurers, and real‑money accounts. Basis widening typically reflects elevated USD demand, reduced hedge ratios, and impaired FX swap market liquidity.
To approximate this behavior in real time, the indicator combines:
- **USDJPY spot**, which tends to accelerate higher during USD funding stress, FX swap dislocations, or shifts in BOJ/Fed policy differentials.
- **JP10Y (Japan 10‑year yield)**, which captures JGB‑market stress, duration‑hedging flows, and the impact of FX‑hedged UST carry dynamics on domestic rates.
The joint behavior of these two series provides a high‑signal proxy for USD/JPY basis conditions, particularly around quarter‑end, fiscal year‑end, and BOJ policy events.
### **2. U.S. Front‑End Curve Stress (Repo/Collateral Proxy)**
Stress in the U.S. repo market often manifests first in the front end of the Treasury curve, where funding volatility, collateral scarcity, and dealer balance‑sheet compression drive rapid curve distortions.
The indicator tracks:
- **US02Y – US10Y (2s10s spread)** as a public‑market proxy for repo tightness, GC specialness, and leveraged Treasury basis‑trade unwind risk.
A deeper inversion or accelerated flattening of the 2s10s curve frequently coincides with rising funding premia, increased margin requirements, and deleveraging across rates‑sensitive strategies.
### **3. Stress Diagnostics**
The script highlights three conditions that historically align with elevated cross‑asset fragility:
- **USDJPY > 20‑day SMA** — proxy for USD funding stress / basis widening
- **JP10Y < 20‑day SMA** — proxy for JGB‑market stress or hedging‑related duration flows
- **2s10s < –0.50** — proxy for front‑end funding pressure and repo‑related curve distortions
These are not directional trading signals. They are **liquidity‑risk diagnostics** intended to identify periods when global funding markets become more vulnerable to synchronized deleveraging.
### **4. Intended Use Case**
This tool is designed for macro practitioners, cross‑asset strategists, and risk managers who monitor:
- USD funding premia and cross‑currency basis dynamics
- FX‑hedged UST flows and Japanese institutional positioning
- Treasury basis‑trade leverage and repo‑driven volatility
- BOJ/Fed policy interactions and quarter‑end balance‑sheet effects
- Systemic liquidity conditions across FX, rates, and credit
The indicator provides a real‑time dashboard for identifying early‑stage liquidity stress that may precede broader cross‑asset volatility.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。