OPEN-SOURCE SCRIPT

BTC/XAU Correlation Crossing Delay Performance

271
OVERVIEW
The BTC/XAU Correlation Crossing Delay Performance indicator is a specialized macro-tool designed to track the structural relationship between Bitcoin (Digital Gold) and Physical Gold. In institutional finance, these two assets represent the "Scarcity Complex." While they are often viewed as similar, they move in distinct Regime Shifts. This script identifies the exact moments of correlation decoupling—historically a lead indicator for major Bitcoin volatility and catch-up rallies.

THE IDEA: THE DECOUPLING SIGNAL
Traditional safe havens like Gold often act as a "Smoke Alarm" for geopolitical fear. Bitcoin, however, functions more as a "Fire Department" for global liquidity expansion. When the 52-week correlation between the two drops to zero or below, it signals a structural divergence.

Data from the past can suggest that such "Zero-Cross" events occur when Gold has front-run a price move, leaving Bitcoin at a relative valuation discount. This script marks these "Regime Shifts" (M-Markers) and measures the subsequent performance during a customizable Alpha Window.

CALCULATIONS & METHODOLOGY
The script utilizes the following logic to generate its data points:
Purchasing Power Ratio: Calculated as Bitcoin Price divided by Gold Price. This shows exactly how many ounces of gold 1 BTC can buy.
Pearson Correlation: A rolling 52-week calculation measuring the linear relationship between BTC and Gold prices.
Zero-Cross Signal: A logic trigger/Marker that fires when the correlation value drops from a positive state to zero or a negative value.(M1 - M-n)
Alpha Performance: A secondary calculation that captures the BTC price at the signal bar and compares it to the price exactly N-weeks later.

HOW TO READ THE CHART
Orange Line: The current BTC/Gold ratio. A rising line means Bitcoin is gaining purchasing power against Gold.
Orange Vertical Shapes (M-n): These mark the "M-Signals" where correlation broke (correlation ratio turned from positive to 0 or below on that bar). This is the "coiled spring" phase.
Blue Vertical Shapes (Result): These appear after your defined Alpha Window (e.g., 12 weeks). They display the percentage change for both the Ratio and BTC/USD price since the M-n-signal.
Blue Area (middle Lane): A visualization of the raw correlation value. When this cloud disappears toward the zero-level, a regime shift is in progress.

USER INPUTS
Tickers: Choose your preferred Bitcoin and Gold sources (e.g., INDEX:BTCUSD or TVC:GOLD).
Correlation Lookback: Default is 52 weeks, the institutional standard for measuring annual macro cycles.
Alpha Window: Define the number of weeks (e.g., 12) you wish to track after a decoupling signal to verify historical catch-up trends.

TIMEFRAME
I view the data on the weekly timeframe. The script is optimized to run on this timeframe.

DISCLAIMER
This script is provided for educational and research purposes only. Correlation shifts are indicators of market structure changes and do not guarantee future price direction. Past performance of the BTC/Gold ratio is not an indicator of future results. Always use comprehensive risk management when trading high-volatility assets.

TAGS
Rob Maths, robmaths, Rob_Maths, Bitcoin, Gold, Ratio, Correlation, Macro

免責事項

この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。