OPEN-SOURCE SCRIPT

Global Macro Index

41
Global Macro Index

The Global Macro Index is a comprehensive economic sentiment indicator that aggregates 23 real-time macroeconomic data points from the world's largest economies (US, EU, China, Japan, Taiwan). It provides a single normalized score that reflects the overall health and momentum of the global economy, helping traders identify macro trends that drive asset prices.

⚠️ Important: Timeframe Settings
This indicator is designed exclusively for the 1W (weekly) timeframe. The indicator is hardcoded to pull weekly data and will not function correctly on other timeframes.
What It Measures
The indicator tracks normalized Trend Power Index (TPI) values across multiple economic categories:
United States (7 components)

Business Confidence Index (BCOI) - Business sentiment and outlook
Composite Leading Indicator (CLI) - Forward-looking economic indicators
Consumer Confidence Index (CCI) - Consumer sentiment and spending intentions
Terms of Trade (TOT) - Import/export price relationships
Manufacturing Composite - Combines business confidence, production, and new orders
Comprehensive Economic Composite - Broad aggregation including employment, business activity, and regional indicators
Business Inventory (BI) - Stock levels and supply chain health

European Union (10 components)

Sentiment Survey (SS) - Overall economic sentiment
Business Confidence Index - EU business outlook
Economic Sentiment Indicator (ESI) - Combined confidence metrics
Manufacturing Production (MPRYY) - Industrial output year-over-year
New Orders - Germany, France, Netherlands, Spain manufacturing orders
Composite Leading Indicators - Germany, France forward-looking metrics
Business Climate Index (BCLI) - France business conditions

Asia (6 components)

New Orders - China, Japan, Taiwan manufacturing demand
Composite Leading Indicators - China, Japan economic momentum

The Formula
The indicator calculates a weighted average of normalized TPI scores:
Global Macro Index = (1/23) × Σ[TPI(economic_indicator)]
Each of the 23 economic indicators is:

Converted to a Trend Power Index (TPI) using 4-day Bitcoin normalization
Weighted equally (1/23 ≈ 4.35% each)
Summed and smoothed with a 1-period SMA

The result is a single oscillator that ranges typically between -1 and +1, with extreme readings beyond ±0.6.
Z-Score Signal System
The indicator includes an optional Z-Score overlay that identifies extreme macro conditions:
Calculation:

Z-Score = (Current Value - 50-period Mean) / Standard Deviation
Smoothed with 35-period Hull Moving Average
Inverted for intuitive interpretation

Signals:

Green background (Z-Score ≥ 2) = Extremely positive macro conditions, potential overbought
Red background (Z-Score ≤ -2) = Extremely negative macro conditions, potential oversold
These extreme readings occur approximately 5% of the time statistically

How to Use It
Interpreting the Main Plot (Red Line):

Above 0 = Positive macro momentum, risk-on environment
Below 0 = Negative macro momentum, risk-off environment
Above +0.6 = Strong expansion, bullish for equities and crypto
Below -0.6 = Severe contraction, bearish conditions
Trend direction = More important than absolute level

Z-Score Signals:

Z ≥ 2 (Green) = Macro sentiment extremely positive, consider taking profits or preparing for pullback
Z ≤ -2 (Red) = Macro sentiment extremely negative, potential buying opportunity for contrarians
Works best as a regime filter, not precise timing tool

Best Practices:

Use as a macro regime filter for other strategies
Combines well with liquidity indicators and price action
Leading indicator for risk assets (equities, Bitcoin, emerging markets)
Lagging indicator - confirms macro trends rather than predicting reversals
Watch for divergences: price making new highs while macro weakens (bearish) or vice versa (bullish)

Settings

Show Zscore Signals: Toggle green/red background shading for extreme readings
Overlay Zscore Signals: Display Z-Score signals on the price chart as well as the indicator panel

Reference Lines

0 (gray) = Neutral macro conditions
+0.6 (green) = Strong positive threshold
-0.6 (red) = Strong negative threshold

Data Sources
Real-time economic data from TradingView's ECONOMICS database, including:

OECD leading indicators
Manufacturing PMIs and new orders
Consumer and business confidence surveys
Trade and inventory metrics
Regional economic sentiment indices



Notes

This is a macro trend indicator, not a day-trading tool. Economic data updates weekly and reflects the aggregate health of global growth. Best used on weekly timeframes to identify favorable or unfavorable macro regimes for risk asset allocation.
The indicator distills complex global economic data into a single actionable score, answering: "Is the global economy expanding or contracting right now?"

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.