OPEN-SOURCE SCRIPT
已更新 10Y Yield Spread - Auto FX Pair

10Y Yield Spread — Auto FX Pair
Automatically displays the 10-year government bond yield spread for the FX pair currently on your chart. Switch from EURUSD to USDJPY to GBPAUD and the indicator instantly recalculates — no manual reconfiguration needed.
What it shows
The spread between the base currency's 10Y yield and the quote currency's 10Y yield, expressed in basis points. For example:
A positive spread (green) means the base currency offers a yield premium — historically a tailwind for the pair. A negative spread (red) means the opposite. The wider the spread, the stronger the rates differential pushing the pair.
Why it matters
Yield differentials are one of the most reliable medium-term drivers of major FX pairs. When the spread trends one way and the pair trends the other, you're often looking at a setup waiting to resolve — either the pair catches up, or the spread breaks. Particularly powerful for:
Supported pairs
All combinations of the 8 majors: USD, EUR, JPY, GBP, AUD, NZD, CAD, CHF. Auto-detection works on standard naming (EURUSD, EUR/USD, OANDA:USDJPY, FX:GBPJPY, etc.). For exotic symbols or futures, switch to Manual mode and pick base/quote from the dropdowns.
Yield benchmarks used
Settings
Recommended setup
Works on any FX chart timeframe from 15m to daily. For best results, pair this with my companion indicator Bond Yield Strength — 10Y Majors to see the full rates landscape alongside the specific spread of your pair.
Notes
DE10Y (German Bund) is used as the EUR proxy — it's the de facto eurozone benchmark used by rates desks globally. Data availability for some symbols depends on your TradingView plan; if a yield doesn't render, your plan may not include that exchange.
Feedback and suggestions welcome.
Automatically displays the 10-year government bond yield spread for the FX pair currently on your chart. Switch from EURUSD to USDJPY to GBPAUD and the indicator instantly recalculates — no manual reconfiguration needed.
What it shows
The spread between the base currency's 10Y yield and the quote currency's 10Y yield, expressed in basis points. For example:
- USD/JPY → US10Y minus JP10Y
- EUR/USD → DE10Y (Bund) minus US10Y
- GBP/AUD → GB10Y minus AU10Y
A positive spread (green) means the base currency offers a yield premium — historically a tailwind for the pair. A negative spread (red) means the opposite. The wider the spread, the stronger the rates differential pushing the pair.
Why it matters
Yield differentials are one of the most reliable medium-term drivers of major FX pairs. When the spread trends one way and the pair trends the other, you're often looking at a setup waiting to resolve — either the pair catches up, or the spread breaks. Particularly powerful for:
- Carry trade decisions (positive spreads = positive carry on the long side)
- Filtering FX trades against the macro backdrop
- Spotting divergences between price and rates
- Anticipating central bank repricing impact across pairs
- Confirming or fading reactions to CPI, NFP, and rate decisions
Supported pairs
All combinations of the 8 majors: USD, EUR, JPY, GBP, AUD, NZD, CAD, CHF. Auto-detection works on standard naming (EURUSD, EUR/USD, OANDA:USDJPY, FX:GBPJPY, etc.). For exotic symbols or futures, switch to Manual mode and pick base/quote from the dropdowns.
Yield benchmarks used
- USD → US10Y (US Treasury)
- EUR → DE10Y (German Bund, eurozone benchmark)
- JPY → JP10Y (JGB)
- GBP → GB10Y (Gilt)
- AUD → AU10Y
- NZD → NZ10Y
- CAD → CA10Y
- CHF → CH10Y
Settings
- Moving average: configurable SMA overlay (default 50) to smooth the spread trend
- Zero line: visual reference for spread sign change
- Background fill: green above zero, red below — instant regime read
- End label: shows current pair and live spread value in bps
- Pair detection: Auto (reads chart ticker) or Manual (override with dropdowns)
Recommended setup
Works on any FX chart timeframe from 15m to daily. For best results, pair this with my companion indicator Bond Yield Strength — 10Y Majors to see the full rates landscape alongside the specific spread of your pair.
Notes
DE10Y (German Bund) is used as the EUR proxy — it's the de facto eurozone benchmark used by rates desks globally. Data availability for some symbols depends on your TradingView plan; if a yield doesn't render, your plan may not include that exchange.
Feedback and suggestions welcome.
版本注释
Update: overlay of the spread on the FX pair开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。