OPEN-SOURCE SCRIPT
Gold Macro Projection Model

GOLD MACRO PROJECTION MODEL
Multi-Factor Fair Value Estimation for Gold
OVERVIEW
The Gold Macro Projection Model estimates gold's fair value based on its historical relationships with key macroeconomic drivers. By synthesizing data from silver, M2 money supply, the US Dollar Index, TIPS (real rates proxy), and major equity indices, this indicator projects where gold should theoretically be trading—helping traders identify potential overvaluation and undervaluation conditions.
HOW IT WORKS
This indicator employs three complementary projection methodologies:
INPUT FACTORS
VISUAL ELEMENTS
INFO TABLE
The indicator displays a real-time information panel showing:
SIGNAL INTERPRETATION
SETTINGS
ALERTS
BEST PRACTICES
Disclaimer: This indicator is for educational purposes only. Past correlations do not guarantee future relationships. Always use proper risk management.
Multi-Factor Fair Value Estimation for Gold
OVERVIEW
The Gold Macro Projection Model estimates gold's fair value based on its historical relationships with key macroeconomic drivers. By synthesizing data from silver, M2 money supply, the US Dollar Index, TIPS (real rates proxy), and major equity indices, this indicator projects where gold should theoretically be trading—helping traders identify potential overvaluation and undervaluation conditions.
HOW IT WORKS
This indicator employs three complementary projection methodologies:
- Correlation-Weighted Z-Score Composite (50% weight)
Calculates rolling correlations between gold and each input factor. Factors with stronger correlations receive more influence. Each factor is normalized to a z-score, combined into a composite, then converted back to gold's price scale. - Silver/Gold Ratio Mean Reversion (35% weight)
The silver/gold ratio historically exhibits mean-reverting behavior. This component projects gold's implied price based on current silver prices and the historical average ratio. - M2 Money Supply Relationship (15% weight)
Gold tracks monetary expansion over long time horizons. This anchors the projection to the fundamental relationship between gold and the monetary base.
INPUT FACTORS
- Silver — Strong positive correlation; precious metals move together
- M2 Money Supply — Positive correlation; gold as inflation hedge
- US Dollar Index (DXY) — Typically negative correlation; inverse relationship
- TIPS ETF — Real interest rate proxy; gold responds to real yields
- Equity Indices — Variable correlation; risk-on/risk-off dynamics
VISUAL ELEMENTS
- Yellow Line — Actual gold price
- Aqua Line — Projected fair value
- Green Fill — Gold trading below projection (potentially undervalued)
- Red Fill — Gold trading above projection (potentially overvalued)
- Aqua Bands — Standard deviation envelope around projection
INFO TABLE
The indicator displays a real-time information panel showing:
- Current actual vs. projected price
- Divergence percentage and Z-score
- Rolling correlations for each factor
- Dynamic weight allocation
- Buy/Sell signal based on divergence extremes
SIGNAL INTERPRETATION
- STRONG BUY — Z-score below -2 (extremely undervalued)
- BUY — Z-score between -2 and -1 (moderately undervalued)
- NEUTRAL — Z-score between -1 and +1 (fairly valued)
- SELL — Z-score between +1 and +2 (moderately overvalued)
- STRONG SELL — Z-score above +2 (extremely overvalued)
SETTINGS
- Correlation Period — Lookback for correlation calculations (default: 60)
- Regression Period — Lookback for mean/standard deviation (default: 120)
- Smoothing Period — EMA smoothing for projection line (default: 10)
- Auto Weights — Toggle between correlation-based or manual weights
- Band Multiplier — Standard deviation multiplier for bands (default: 1.5)
ALERTS
- Gold Extremely Undervalued — Z crosses below -2
- Gold Extremely Overvalued — Z crosses above +2
- Gold Crossed Above Projection
- Gold Crossed Below Projection
BEST PRACTICES
- Use on daily timeframe for most reliable signals
- Combine with the companion Gold Divergence Oscillator for timing
Disclaimer: This indicator is for educational purposes only. Past correlations do not guarantee future relationships. Always use proper risk management.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。