Accurate Global M2 (Top10 GDP, FX-Stabilized)

Many previous versions used noisy daily FX rates, unweighted country data, mixed liquidity categories (e.g., RRP, TGA), or aggregated low-quality sources, causing exaggerated or misleading charts.
This version fixes those problems by:
Using Top 10 global economies only (based on GDP).
GDP-weighting each country's M2 contribution.
Fetching monthly-averaged M2 data.
Applying monthly FX conversions to eliminate daily volatility noise.
Forward-shifting the M2 line (default 90 days) to study potential Bitcoin correlations.
Keeping the math clean, without mixing central bank liquidity tools with broad M2 aggregates.
As a result, this script provides a more realistic and stable representation of global M2 expansion in USD terms, more suitable for serious macroeconomic analysis and Bitcoin market correlation studies.
Added automatic normalization of shifted M2 values to align offset curves with the latest data point.
This improves accuracy when adjusting forward offsets (e.g., 90 days, 150 days) by eliminating unintended visual distortion caused by shifting historical M2 levels. Now only the timing changes, not the scale.
Also improved internal code structure for better chart compatibility and user experience.
Reverted the previous automatic normalization.
Now the M2 line only applies a pure time shift (based on user-selected days) without adjusting or locking to the latest value.
This correctly preserves the true timing differences between M2 liquidity expansion and Bitcoin price action, allowing users to better study potential lead/lag relationships without introducing artificial scaling distortions.
Minor Y-axis value differences between shifts are normal and reflect genuine historical changes in global M2 levels.
Focus remains on observing the timing of trend changes, not exact matching of value heights.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.