OPEN-SOURCE SCRIPT

Blockchain Fundamentals: Liquidity & BTC YoY

Liquidity & BTC YoY Indicator

Overview:
This indicator calculates the Year-over-Year (YoY) percentage change for two critical metrics: a custom Liquidity Index and Bitcoin's price. The Liquidity Index is derived from a blend of economic and forex data representing the M2 money supply, while the BTC price is obtained from a reliable market source. A dedicated function is implemented to handle limited historical data, ensuring that the YoY calculations are available immediately—even when the chart's history is short.

Features Breakdown:

1. Limited Historical Data Workaround
- Functionality: The function dynamically adjusts the lookback period when there isn’t enough historical data. This prevents delays in displaying YoY metrics at the beginning of the chart.

2. Liquidity Calculation
- Data Sources: Combines multiple data streams:

- Formula:
Liquidity Index = USM2 + (CNM2 / USDCNY) + (JPM2 / USDJPY) + (EUM2 / USDEUR)

[b3. Bitcoin Price Calculation
- Data Source: Retrieves Bitcoin's price from BITSTAMP:BTCUSD on the user-selected timeframe for its historical length.

4. Year-over-Year (YoY) Percent Change Calculation
- Methodology:
- The indicator uses a custom function, to autodetect the proper number of bars, based on the selected timeframe.
- It then compares the current value to that from one year ago for both the Liquidity Index and BTC price, calculating the YoY percentage change.

5. Visual Presentation
- Plotting:
- The YoY percentage changes for Liquidity (plotted in blue) and BTC price (plotted in orange) are clearly displayed.
- A horizontal zero line is added for visual alignment, making it easier to compare the two copies of the metric. You add one copy and only display the BTC YoY. Then you add another copy and only display the M2 YoY.
-The zero lines are then used to align the scripts to each other by interposing them. You scale each chart the way you like, then move each copy individually to align both zero lines on top of each other.

This indicator is ideal for analysts and investors looking to monitor macroeconomic liquidity trends alongside Bitcoin's performance, providing immediate insights.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。