OPEN-SOURCE SCRIPT
Actualizado

Global Macro Regime

1 552
The Global Macro Regime is a top-down macro nowcasting and portfolio allocation tool that provides a consolidated view of the market-implied macro regime. It independently evaluates 30 key global markets across equities, fixed income, commodities, and currencies to determine the prevailing macro regime, which informs the model’s portfolio preferences and regime-specific exposures. It also features built-in alerts and an integrated backtester that enable investors to monitor regime changes and evaluate asset performance across different macro environments.

At its core, the model aggregates 30 independent cross-asset market signals to identify shifts in the market’s growth and inflation outlook. Rather than relying on backward-looking economic data, the model derives these signals in real time from evolving trends across global markets. By focusing on growth and inflation, the model captures two of the primary macroeconomic forces driving asset prices. The four possible combinations of growth and inflation define four distinct macro regimes, each of which tends to favor different portfolio preferences and exposures:

  • Goldilocks (Growth ↑, Inflation ↓): Improving growth with low/declining inflation.
  • Reflation (Growth ↑, Inflation ↑): Improving growth with high/rising inflation.
  • Inflation (Growth ↓, Inflation ↑): Deteriorating growth with high/rising inflation.
  • Deflation (Growth ↓, Inflation ↓): Deteriorating growth with low/declining inflation.

Goldilocks and Reflation represent Risk-On regimes, while Inflation and Deflation represent Risk-Off regimes. Each of the 30 selected markets is evaluated independently as either a growth or inflation signal. Markets signaling improving growth contribute to both Goldilocks and Reflation, while markets signaling deteriorating growth contribute to both Inflation and Deflation. Markets signaling high/rising inflation contribute to both Reflation and Inflation, while markets signaling low/declining inflation contribute to both Goldilocks and Deflation. The selected markets are grouped into equities (10), fixed income (10), commodities (6), and currencies (4):

  • Equities = S&P 500 Index (SPX), Russell 2000 Index (RUT), STOXX Europe 600 Index (SXXP), Nikkei 225 Index (NI225), Hang Seng Index (HSI), MSCI Emerging Markets Index Futures (MME), High Beta / Low Volatility Ratio (SPHB/SPLV), Cyclicals / Defensives Ratio (XLY/XLP), S&P 500 Volatility Index (VIX), and 3M Implied Correlation Index (COR3M).
  • Fixed Income = US 2Y Treasury Yield, US 10Y Treasury Yield, German 10Y Bund Yield, UK 10Y Gilt Yield, Japan 10Y JGB Yield, US 10Y Breakeven Inflation Rate, US CCC Distressed Index Option-Adjusted Spread, US High Yield Index Option-Adjusted Spread, US Investment Grade Corporate Index Option-Adjusted Spread, and US Bond Volatility Index (MOVE).
  • Commodities = Brent Crude Oil Futures (BRN), Agricultural Commodities (DBA), Industrial Metals (DBB), Copper Futures (HG), Silver / Gold Ratio (SI/GC), and CME Bitcoin Futures.
  • Currencies = US Dollar Index (DXY), Australian Dollar / US Dollar (AUDUSD), British Pound / US Dollar (GBPUSD), and Euro / US Dollar (EURUSD).

Each market signal is derived independently using either a volatility-adjusted moving-average crossover, a volatility-based adaptive trailing stop, or a combination of both. The signals are then aggregated and normalized into percentage scores representing each regime’s share of total signals, with optional smoothing over the specified signal length to reduce noise. The regime receiving the greatest confirmation across global markets is identified as the dominant macro regime and translated into portfolio preferences displayed in the regime preference table:

  • Goldilocks Preferences = Risk-On > Risk-Off, High Beta > Low Beta, Cyclicals > Defensives, International < US Equities, SMID Caps < Large Caps, Short Rates > Long Rates, Spreads > Treasuries, High Yield > Low Yield, Beta FX > US Dollar, Metals > Energy, and Bitcoin > Gold.
  • Reflation Preferences = Risk-On > Risk-Off, High Beta > Low Beta, Cyclicals > Defensives, International > US Equities, SMID Caps > Large Caps, Short Rates > Long Rates, Spreads > Treasuries, High Yield > Low Yield, Beta FX > US Dollar, Metals > Energy, and Bitcoin > Gold.
  • Inflation Preferences = Risk-On < Risk-Off, High Beta < Low Beta, Cyclicals < Defensives, International < US Equities, SMID Caps < Large Caps, Short Rates > Long Rates, Spreads < Treasuries, High Yield < Low Yield, Beta FX < US Dollar, Metals < Energy, and Bitcoin < Gold.
  • Deflation Preferences = Risk-On < Risk-Off, High Beta < Low Beta, Cyclicals < Defensives, International < US Equities, SMID Caps < Large Caps, Short Rates < Long Rates, Spreads < Treasuries, High Yield < Low Yield, Beta FX < US Dollar, Metals > Energy, and Bitcoin < Gold.

The model further translates these portfolio preferences into specific exposures across equities, fixed income, commodities, and currencies. The selected exposures have been systematically backtested across the four macro regimes, dating back as far as January 1996, to identify those exhibiting the strongest risk-adjusted performance and most consistent directionally aligned trending behavior within each asset class. The resulting exposure lists provide a more granular view of the model’s broader portfolio preferences based on historically observed relationships:

  • Goldilocks Exposures = Equity sectors include Communication Services (XLC), Technology (XLK), Financials (XLF), Industrials (XLI), Consumer Discretionary (XLY), Materials (XLB), and Real Estate (VNQ). Equity factors include S&P 500 (SPY), Nasdaq 100 (QQQ), High Beta (SPHB), Momentum (MTUM), Quality (QUAL), Growth (IWF), and Value (IWD). Fixed income includes High Yield Bonds (HYG), Investment Grade Bonds (LQD), and Convertible Bonds (CWB). Commodities include Bitcoin (BTC), Industrial Metals (DBB), Metal Producers (PICK), Gold (GLD), Gold Miners (GDX), Silver (SLV), Silver Miners (SIL), Copper (CPER), Copper Miners (COPX), Uranium (SRUUF), and Uranium Miners (URNM). Currencies include Australian Dollar (FXA), British Pound (FXB), and Euro (FXE).
  • Reflation Exposures = Equity sectors include Energy (XLE), Communication Services (XLC), Technology (XLK), Financials (XLF), Industrials (XLI), Consumer Discretionary (XLY), Materials (XLB), and Real Estate (VNQ). Equity factors include Global Equities (ACWI), International Equities (ACWX), S&P 500 (SPY), Nasdaq 100 (QQQ), Emerging Markets (EEM), High Beta (SPHB), Mid Caps (IWR), Small Caps (IWM), Momentum (MTUM), Quality (QUAL), Growth (IWF), Value (IWD), Equal Weight (RSP), Global Infrastructure (IGF), and International Real Estate (IFGL). Fixed income includes High Yield Bonds (HYG), Convertible Bonds (CWB), Private Credit (BIZD), and Emerging Market Bonds (EMB). Commodities include Bitcoin (BTC), Commodities (DBC), Industrial Metals (DBB), Metal Producers (PICK), Crude Oil (USO), Agriculture (DBA), Agriculture Producers (VEGI), Gold (GLD), Gold Miners (GDX), Silver (SLV), Silver Miners (SIL), Copper (CPER), Copper Miners (COPX), Uranium (SRUUF), and Uranium Miners (URNM). Currencies include Australian Dollar (FXA), Canadian Dollar (FXC), British Pound (FXB), and Euro (FXE).
  • Inflation Exposures = Equity sectors include Energy (XLE), Consumer Staples (XLP), Utilities (XLU), and Health Care (XLV). Equity factors include Low Volatility (SPLV). Fixed income includes 1-3 Month Treasury Bills (BIL). Commodities include Commodities (DBC), Crude Oil (USO), Agriculture (DBA), and Gold (GLD). Currencies include US Dollar (UUP).
  • Deflation Exposures = Equity sectors include Consumer Staples (XLP), Utilities (XLU), and Health Care (XLV). Equity factors include Low Volatility (SPLV) and High Dividend (SPHD). Fixed income includes 1-3 Year Treasuries (SHY), 7-10 Year Treasuries (IEF), 20+ Year Treasuries (TLT), US Aggregate Bonds (AGG), Mortgage-Backed Securities (MBB), and International Aggregate Bonds (BNDX). Commodities include Gold (GLD). Currencies include US Dollar (UUP) and Japanese Yen (FXY).

The model includes a built-in alert system that notifies investors in real time when the dominant macro regime changes and provides the corresponding exposures for the new regime. It also features an integrated backtesting engine that can be enabled in the menu to evaluate asset performance across the macro regimes. Users can assign an asset to each regime, with the backtest automatically rotating into the corresponding asset whenever that regime becomes dominant. If one or more assets are assigned, any unassigned regimes are treated as cash. If no assets are assigned, the chart ticker is assigned to Goldilocks and Reflation, while Inflation and Deflation are treated as cash. The backtest reports the following performance metrics:

  • CAGR = Compounded Annual Growth Rate.
  • Excess = CAGR in excess of buy-and-hold.
  • Sharpe = CAGR per unit of standard deviation.
  • Sortino = CAGR per unit of downside deviation.
  • Calmar = CAGR relative to maximum drawdown.
  • Max DD = Largest peak-to-trough decline in value.
  • Alpha (α) = Excess annualized risk-adjusted returns.
  • Win Rate = Ratio of profitable trades to total trades.
  • Profit Factor = Total gross profit per unit of losses.
  • Expectancy = Average expected return per trade.
  • Turnover = Average annualized change in exposure.

The indicator is designed with flexibility in mind, allowing users to select the backtest period, signal methodology, preferred trend type, volatility type, and the individual markets included in the regime calculation. Supported moving-average types include the Exponential Moving Average (EMA), Simple Moving Average (SMA), Wilder’s Moving Average (RMA), and Weighted Moving Average (WMA). Supported volatility types include the Average True Range (ATR), Standard Deviation (SD), and Mean Absolute Deviation (MAD). The table follows an intuitive color-coded logic that allows for quick performance comparison against buy-and-hold (B&H):

  • CAGR = Green indicates above 0%, while red indicates below 0%.
  • Excess = Green indicates above 0%, while red indicates below 0%.
  • Sharpe = Green indicates better than B&H, while red indicates worse.
  • Sortino = Green indicates better than B&H, while red indicates worse.
  • Calmar = Green indicates better than B&H, while red indicates worse.
  • Max DD = Green indicates better than B&H, while red indicates worse.
  • Alpha (α) = Green indicates above 0%, while red indicates below 0%.
  • Win Rate = Green indicates above 50%, while red indicates below 50%.
  • Profit Factor = Green indicates above 2, while red indicates below 1.
  • Expectancy = Green indicates above 0%, while red indicates below 0%.

In summary, the Global Macro Regime is a comprehensive market-based macro framework designed to identify the prevailing macro regime. By combining 30 independent cross-asset market signals, the model translates the dominant macro regime into portfolio preferences and regime-specific exposures based on historical relationships that may not persist under future market conditions as market dynamics and asset-specific characteristics evolve over time. Historical coverage also varies across the 30 selected markets, with regime signals prior to 2006 based on progressively fewer markets and therefore requiring more cautious interpretation.
Notas de prensa
Improved script execution and simplified the menu interface and alert messages.

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.