OPEN-SOURCE SCRIPT
[c3s] CWS - M2 Global Liquidity Index & BTC Correlation

[c3s] CWS - M2 Global Liquidity Index with Offset BTC Correlation
This custom indicator visualizes and analyzes the relationship between the global M2 money supply and Bitcoin (BTC) price movements. It calculates the correlation between these two variables to provide insights into how changes in global liquidity may impact Bitcoin’s price over time.
Key Features:
Inputs:
Usage:
Ideal for traders and analysts seeking to understand the relationship between global liquidity and Bitcoin price. The offset and lookback period can be adjusted to explore different timeframes and correlation strengths, aiding more informed trading decisions.
This custom indicator visualizes and analyzes the relationship between the global M2 money supply and Bitcoin (BTC) price movements. It calculates the correlation between these two variables to provide insights into how changes in global liquidity may impact Bitcoin’s price over time.
Key Features:
- Global M2 Liquidity Index Calculation:
Fetches M2 money supply data from multiple economies (China, US, EU, Japan, UK) and normalizes using currency exchange rates (e.g., CNY/USD, EUR/USD).
Combines all M2 data points and normalizes by dividing by 1 trillion (1e12) for easier visualization. - Offset for M2 Data:
The offset parameter allows users to shift the M2 data by a specified number of days, helping track the influence of past global liquidity on Bitcoin. - BTC Price Correlation:
Computes the correlation between shifted global M2 liquidity and Bitcoin (BTC) price, using a 52-day lookback period by default. - Correlation Quality Display:
Categorizes correlation quality as:
Excellent: Correlation >= 0.8
Good: Correlation >= 0.6 and < 0.8
Weak: Correlation >= 0.4 and < 0.6
Very Weak: Correlation < 0.4
Displays correlation quality as a label on the chart for easy assessment. - Visual Enhancements:Labels: Displays dynamic labels on the chart with metrics like M2 value and correlation.
Plot Shapes: Uses shapes to indicate data availability for global M2 and correlation.
Data Table: Optionally shows a data table in the top-right corner summarizing:
Global M2 value (in trillions)
The correlation between global M2 and BTC
The correlation quality - Optional Debugging:Debug plots help identify when data is missing for M2 or correlation, ensuring transparency and accurate functionality.
Inputs:
- []Offset: Shift the M2 data (in days) to see past liquidity effects on Bitcoin.
[]Lookback Period: Number of periods (default 52) used to calculate the correlation.
[]Show Labels: Toggle to show or hide labels for M2 and correlation values.
[]Show Table: Toggle to show or hide the data table in the top-right corner.
Usage:
Ideal for traders and analysts seeking to understand the relationship between global liquidity and Bitcoin price. The offset and lookback period can be adjusted to explore different timeframes and correlation strengths, aiding more informed trading decisions.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.