OPEN-SOURCE SCRIPT
Global Debt-to-GDP Dashboard

I've created this macro indicator to monitor world debt. The Global Debt-to-GDP Dashboard helps you to track, compare, and analyze sovereign and private debt levels across 20 major economies.
It provides institutional-grade debt analysis, allowing traders, long term investors and macro investors to identify systemic risks, divergences from global norms, and accelerating debt trends that could signal future economic instability or opportunities.
What It Does
This indicator transforms complex macroeconomic data into actionable insights to understand country leverage by:
Key Features
Three Divergence Analysis Modes
Use Cases
For Macro Traders
For Long-Term Investors
How to Use
Table Risk Scores:
🔴🔴🔴 Extreme Risk: Divergence > +100pp above average
🔴🔴 High Risk: Divergence > +50pp above average
🟠 Moderate Risk: Divergence > 0pp above average
🟢 Low Risk: Divergence > -50pp below average
🟢🟢 Very Low Risk: Divergence < -50pp below average
NOTE: "Low Risk" and low-debt might also mean that a country is unable to finance through the issuance of government debt. This is not necessarily a good thing and might not correspond to low risk.
Velocity Indicators:
⬆️⬆️⬆️ Rapid Acceleration: +5pp or more per period
⬆️⬆️ Strong Acceleration: +2 to +5pp per period
⬆️ Moderate Increase: +0.5 to +2pp per period
➡️ Stable: -0.5 to +0.5pp per period
⬇️ Moderate Decrease: -2 to -0.5pp per period
⬇️⬇️ Strong Deceleration: -5 to -2pp per period
⬇️⬇️⬇️ Rapid Deceleration: -5pp or less per period
Important Notes
Let me know if you have comments or suggestions.
Truly yours, Henrique Centieiro
It provides institutional-grade debt analysis, allowing traders, long term investors and macro investors to identify systemic risks, divergences from global norms, and accelerating debt trends that could signal future economic instability or opportunities.
What It Does
This indicator transforms complex macroeconomic data into actionable insights to understand country leverage by:
- Tracking Dual Debt Metrics: Monitors both government debt-to-GDP and private debt-to-GDP ratios for 20 countries. This provides a complete picture of total leverage in each economy.
- Divergence Analysis: Compares each country's debt levels against the world average (calculated from selected countries), instantly highlighting which economies are over-leveraged or under-leveraged relative to global norms.
- Velocity Tracking: Calculates the rate of change in debt divergence, identifying which countries are rapidly increasing or decreasing their debt burden.
- Risk Assessment: Automatically categorizes countries by risk level using color-coded visual indicators
Key Features
- 20 Major Economies: USA, China, Japan, Germany, UK, France, Italy, Canada, Spain, Australia, South Korea, Brazil, India, Mexico, Switzerland, Singapore, Norway, Saudi Arabia, Russia, and Turkey
- Simultaneous Visualization: Plot all selected countries on a single chart with unique color coding for easy identification
- Dynamic Country Selection: Enable/disable countries to focus on specific regions or economic blocs
Three Divergence Analysis Modes
- Government Only: Analyze sovereign debt divergence from government debt average
- Private Only: Focus exclusively on private sector leverage (excludes countries without private debt data)
- Total (Gov + Private): Comprehensive view of total economy-wide debt burden [DEFAULT]
Use Cases
For Macro Traders
- Identify Sovereign Risk: Spot countries with unsustainable debt trajectories before credit events
- Currency Pairs: Correlate debt divergence with currency strength/weakness
- Bond Markets: Anticipate yield spread movements based on relative debt positions
- Risk-On/Risk-Off: Use global debt velocity as a systemic risk indicator
For Long-Term Investors
- Country Allocation: Make informed decisions about geographic exposure
- Risk Management: Avoid over-exposure to high-debt economies
- Opportunity Identification: Find under-leveraged economies with growth potential
- Portfolio Rebalancing: Use debt trends as signals for portfolio adjustments
How to Use
- Initial Setup: Select the countries you want to monitor from the Settings panel
- Choose Divergence Type: Select Government Only, Private Only, or Total debt analysis
- Configure Display: Adjust table position, text size, and sorting preferences
- Set Alerts (Optional): Define your alert thresholds and enable notifications
Table Risk Scores:
🔴🔴🔴 Extreme Risk: Divergence > +100pp above average
🔴🔴 High Risk: Divergence > +50pp above average
🟠 Moderate Risk: Divergence > 0pp above average
🟢 Low Risk: Divergence > -50pp below average
🟢🟢 Very Low Risk: Divergence < -50pp below average
NOTE: "Low Risk" and low-debt might also mean that a country is unable to finance through the issuance of government debt. This is not necessarily a good thing and might not correspond to low risk.
Velocity Indicators:
⬆️⬆️⬆️ Rapid Acceleration: +5pp or more per period
⬆️⬆️ Strong Acceleration: +2 to +5pp per period
⬆️ Moderate Increase: +0.5 to +2pp per period
➡️ Stable: -0.5 to +0.5pp per period
⬇️ Moderate Decrease: -2 to -0.5pp per period
⬇️⬇️ Strong Deceleration: -5 to -2pp per period
⬇️⬇️⬇️ Rapid Deceleration: -5pp or less per period
Important Notes
- Data Availability: Some countries lack private debt data (e.g., China, India, Brazil).
- World Average Calculation: The world average is dynamically calculated based on your selected countries, not a fixed global figure. This allows for custom peer group comparisons.
- Percentage Points vs Percentages: All divergence values are in percentage points (pp), representing the absolute difference from the average, not a relative percentage change.
Let me know if you have comments or suggestions.
Truly yours, Henrique Centieiro
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Hedge Fund Manager at Maverick Capital | Wealth Educator | 20+ yrs investing | Stocks, ETFs & Crypto alerts | Join Henrique Wealth Academy for trade alerts & indicators → skool.com/be-limitless/
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Hedge Fund Manager at Maverick Capital | Wealth Educator | 20+ yrs investing | Stocks, ETFs & Crypto alerts | Join Henrique Wealth Academy for trade alerts & indicators → skool.com/be-limitless/
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。