PROTECTED SOURCE SCRIPT
DCA Gold Benchmark

Overview
The DCA Gold Benchmark indicator provides a relative valuation tool for assessing an asset's price (such as stocks, cryptocurrencies, commodities, bonds, or forex pairs) against gold priced in the chart's quote currency, treating gold as a reference for value preservation.
It derives a benchmark from the asset's historical relationship to gold across supported currencies, then scales it to overlay on the price chart for visual comparison to gold-implied fair value. Deviations from this benchmark are emphasized.
An envelope, based on historical variability, surrounds the benchmark line to suggest potential overvaluation (price above upper envelope, consider sell) or undervaluation (price below lower envelope, consider buy).
Supported quote currencies: USD (XAUUSD), AUD (XAUAUD), EUR (XAUEUR), GBP (XAUGBP), JPY (XAUJPY), CAD (XAUCAD). For unsupported currencies or assets, it defaults to USD gold pricing.
How It Works
Gold Price Fetch: The indicator automatically detects the chart's quote currency and fetches the corresponding gold price symbol. If unsupported, it falls back to XAUUSD.
Asset in Gold Terms: Computes the asset's value relative to gold.
Benchmark Calculation: Derives a smoothed benchmark from the asset-in-gold relationship over the lookback period, then scales it for overlay on the price chart.
Envelopes: Forms upper and lower bands based on variability in the asset-in-gold data around the benchmark.
Deviation Metrics: Computes raw deviation, percentage deviation, and normalized deviation for display in the table.
Note: Gold data may have daily resolution, potentially causing slight lag on intraday charts. All calculations use built-in TradingView functions for transparency.
Inputs
Lookback Period (default: 200): The length for the smoothed benchmark and standard deviation calculations. Longer periods smooth the benchmark for long-term analysis; shorter ones increase sensitivity for trading.
Deviation Multiplier for Envelope (default: 1.5): Adjusts the width of the upper/lower envelopes. Higher values widen the bands for fewer signals; lower values tighten them for more frequent touches.
Interpretation
Benchmark Line (Yellow): Represents the asset's "fair value" based on its historical relationship to gold. Price above suggests potential overvaluation vs. gold; below indicates undervaluation.
Upper Envelope (Green): Potential resistance level; price touching or exceeding may signal overextension.
Lower Envelope (Red): Potential support level; price dropping to or below may indicate buying opportunities.
Envelope Fill (Blue): Visual range highlighting the benchmark channel.
Table Metrics (Top-Right):Benchmark: Current scaled fair value.
Asset in Gold: Asset's value in ounces of gold.
Price Deviation: Raw and percentage difference from benchmark (green for positive, red for negative).
Norm Deviation: Standardized deviation (z-score-like); values >1 or <-1 may indicate extremes for mean-reversion trades.
Explanation: Quick guide to signals.
Positive deviations might suggest selling or hedging; negative ones could favor accumulation, especially in DCA strategies. Always confirm with volume, trends, or fundamentals.
Usage Examples
Stocks/ETFs: Apply to SPY or individual stocks to gauge inflation-adjusted value vs. gold during economic uncertainty.
Cryptocurrencies: On BTCUSD or ETHUSD, identify periods where crypto is "cheap" vs. gold for long-term holds.
Forex/Commodities: For pairs like EURUSD, it highlights currency strength relative to gold; for oil (CL1!), assess energy vs. precious metals.
Timeframes: Best on daily+ for reliability; intraday may show more noise due to gold data.
Combine with other indicators (e.g., RSI for momentum) for a better context.
Backtest on historical data to evaluate performance in your strategy.
Limitations
Relies on gold as a stable benchmark, which may not hold in all markets (gold can be volatile due to supply/demand or speculation).
Assumes currency detection accuracy; non-supported currencies default to USD, potentially skewing international assets.
Not a predictive tool—deviations can persist in strong trends. No guarantees of accuracy or profitability; use at your own risk.
Data availability: Gold symbols may vary by broker; test on your setup.
This is for informational purposes; combine with other analysis and do not use as sole trading advice. Tested on: BTCUSD (with USD gold), S&P 500 (SPX or SPY), Nasdaq (NDX or QQQ), Dow Jones (DJI), a variety of stocks (e.g., AAPL, NVDA, TSLA), and forex pairs (e.g., EURUSD with EUR gold, USDJPY with JPY gold) - handles various asset types automatically.
The DCA Gold Benchmark indicator provides a relative valuation tool for assessing an asset's price (such as stocks, cryptocurrencies, commodities, bonds, or forex pairs) against gold priced in the chart's quote currency, treating gold as a reference for value preservation.
It derives a benchmark from the asset's historical relationship to gold across supported currencies, then scales it to overlay on the price chart for visual comparison to gold-implied fair value. Deviations from this benchmark are emphasized.
An envelope, based on historical variability, surrounds the benchmark line to suggest potential overvaluation (price above upper envelope, consider sell) or undervaluation (price below lower envelope, consider buy).
Supported quote currencies: USD (XAUUSD), AUD (XAUAUD), EUR (XAUEUR), GBP (XAUGBP), JPY (XAUJPY), CAD (XAUCAD). For unsupported currencies or assets, it defaults to USD gold pricing.
How It Works
Gold Price Fetch: The indicator automatically detects the chart's quote currency and fetches the corresponding gold price symbol. If unsupported, it falls back to XAUUSD.
Asset in Gold Terms: Computes the asset's value relative to gold.
Benchmark Calculation: Derives a smoothed benchmark from the asset-in-gold relationship over the lookback period, then scales it for overlay on the price chart.
Envelopes: Forms upper and lower bands based on variability in the asset-in-gold data around the benchmark.
Deviation Metrics: Computes raw deviation, percentage deviation, and normalized deviation for display in the table.
Note: Gold data may have daily resolution, potentially causing slight lag on intraday charts. All calculations use built-in TradingView functions for transparency.
Inputs
Lookback Period (default: 200): The length for the smoothed benchmark and standard deviation calculations. Longer periods smooth the benchmark for long-term analysis; shorter ones increase sensitivity for trading.
Deviation Multiplier for Envelope (default: 1.5): Adjusts the width of the upper/lower envelopes. Higher values widen the bands for fewer signals; lower values tighten them for more frequent touches.
Interpretation
Benchmark Line (Yellow): Represents the asset's "fair value" based on its historical relationship to gold. Price above suggests potential overvaluation vs. gold; below indicates undervaluation.
Upper Envelope (Green): Potential resistance level; price touching or exceeding may signal overextension.
Lower Envelope (Red): Potential support level; price dropping to or below may indicate buying opportunities.
Envelope Fill (Blue): Visual range highlighting the benchmark channel.
Table Metrics (Top-Right):Benchmark: Current scaled fair value.
Asset in Gold: Asset's value in ounces of gold.
Price Deviation: Raw and percentage difference from benchmark (green for positive, red for negative).
Norm Deviation: Standardized deviation (z-score-like); values >1 or <-1 may indicate extremes for mean-reversion trades.
Explanation: Quick guide to signals.
Positive deviations might suggest selling or hedging; negative ones could favor accumulation, especially in DCA strategies. Always confirm with volume, trends, or fundamentals.
Usage Examples
Stocks/ETFs: Apply to SPY or individual stocks to gauge inflation-adjusted value vs. gold during economic uncertainty.
Cryptocurrencies: On BTCUSD or ETHUSD, identify periods where crypto is "cheap" vs. gold for long-term holds.
Forex/Commodities: For pairs like EURUSD, it highlights currency strength relative to gold; for oil (CL1!), assess energy vs. precious metals.
Timeframes: Best on daily+ for reliability; intraday may show more noise due to gold data.
Combine with other indicators (e.g., RSI for momentum) for a better context.
Backtest on historical data to evaluate performance in your strategy.
Limitations
Relies on gold as a stable benchmark, which may not hold in all markets (gold can be volatile due to supply/demand or speculation).
Assumes currency detection accuracy; non-supported currencies default to USD, potentially skewing international assets.
Not a predictive tool—deviations can persist in strong trends. No guarantees of accuracy or profitability; use at your own risk.
Data availability: Gold symbols may vary by broker; test on your setup.
This is for informational purposes; combine with other analysis and do not use as sole trading advice. Tested on: BTCUSD (with USD gold), S&P 500 (SPX or SPY), Nasdaq (NDX or QQQ), Dow Jones (DJI), a variety of stocks (e.g., AAPL, NVDA, TSLA), and forex pairs (e.g., EURUSD with EUR gold, USDJPY with JPY gold) - handles various asset types automatically.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
⚡️ Request a trial or subscribe to our premium🛠️tools at ➡️DCAlpha.net
All scripts & content provided by DCAChampion are for informational & educational purposes only.
All scripts & content provided by DCAChampion are for informational & educational purposes only.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
⚡️ Request a trial or subscribe to our premium🛠️tools at ➡️DCAlpha.net
All scripts & content provided by DCAChampion are for informational & educational purposes only.
All scripts & content provided by DCAChampion are for informational & educational purposes only.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.