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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。