OPEN-SOURCE SCRIPT
Global Liquidity Indicators VS Bitcoin | TR

🎯 Overview
Global Liquidity Indicators VS Bitcoin | TR is a macro‑economic divergence and consensus oscillator that compares Bitcoin's momentum against a composite Global Liquidity index. Instead of relying on a single metric, it aggregates up to five technical analysis tools (ROC, CCI, RSI, MFI, CMO) into a weighted voting system. The indicator applies user‑defined lags to both series, allowing traders to test leading/lagging relationships between liquidity conditions and Bitcoin price action. The final output is a normalised consensus score (‑100 to +100), displayed via dynamic background colouring, raw TA line overlays, and a prominent trend table for immediate directional bias.
⚙️ Core Calculations
Data Sourcing
The indicator requests closing prices from two custom tickers:
Bitcoin (BTC): INDEX:BTCUSD
Global Liquidity (LIQ): A composite basket defined as
TVC:CN10Y/TVC:DXY/FRED:BAMLH0A0HYM2*(ECONOMICS:USCBBS+FRED:JPNASSETS/FX:USDJPY+ECONOMICS:CNCBBS/FX_IDC:USDCNY+FRED:ECBASSETSW/FX_IDC:USDEUR)
This combines yield curves, FX rates, central bank balance sheets, and credit spreads into a single synthetic price series.
Technical Analysis Engine
For both BTC and LIQ, the indicator computes up to five separate momentum/oscillator values over user‑defined lengths:
ROC (Rate of Change) – default 90 for BTC, 63 for LIQ
CCI (Commodity Channel Index)
RSI (Relative Strength Index)
MFI (Money Flow Index)
CMO (Chande Momentum Oscillator)
Each TA variant is calculated independently, giving a multi‑faceted view of each asset’s internal momentum.
Lag Application
Every computed TA value is shifted by a user‑defined lag:
BTC_Lag (default 0) – shifts Bitcoin’s data forward/backward.
LIQ_Lag (default 101) – shifts Liquidity’s data.
This is the core differentiator: by applying a lag to Liquidity, the indicator can test whether past liquidity changes predict current Bitcoin moves (positive lag) or vice‑versa.
Binary Scoring & Consensus
For each enabled TA tool (enableROC, enableCCI, etc.), the indicator compares the lagged BTC value against the lagged LIQ value:
BTC > LIQ → score = +1 (bullish for BTC)
BTC < LIQ → score = -1 (bearish for BTC)
The total score is summed across all enabled indicators, then divided by the number of active tools (active) to produce an average:
text
percentual_btc = (sum_of_scores / active) * 100
The result ranges from ‑100 (all indicators favour Liquidity) to +100 (all indicators favour Bitcoin).
Primary TA Line (for visual plotting)
The user can select one TA type (TA input) to plot as the raw line overlay for both assets. This line is also shifted by its respective lag, allowing visual comparison of the chosen metric directly on the chart.
📈 Signal System
Trend Bias (Consensus)
Bullish Regime (Bull_BTC): percentual_btc > 0 → more than 50% of enabled indicators favour Bitcoin over Liquidity.
Bearish Regime (Bear_BTC): percentual_btc < 0 → more than 50% of enabled indicators favour Liquidity over Bitcoin.
Neutral: exactly 0 (rare, but possible when active is even and scores cancel out).
Crossing Zero
While not explicitly plotted as a crossover line, a shift from positive to negative (or vice‑versa) signals a change in the macro consensus – i.e., Liquidity is gaining/losing relative strength against Bitcoin.
Background Zone
The entire chart background is tinted:
Green (bullish) when consensus favours Bitcoin.
Red (bearish) when consensus favours Liquidity.
Transparency is fixed at 95%, keeping price action fully readable.
🎨 Visual Features
Primary TA Overlays
Two plotted lines (BTC in orange, LIQ in blue) display the user‑selected technical indicator (ROC, CCI, RSI, MFI, or CMO). Both respect their respective lag offsets, letting you visually assess divergences and crossovers.
9 Colour Themes
Choose from Classic, Modern, Heat, Robust, Accented, Monochrome, Moderate, Aqua, or Cosmic. These define the specific shades used for the bullish (UpC) and bearish (DnC) background fills and the trend table text.
Trend Table
A persistent, large‑font table positioned at the middle‑right of the chart displays:
⬆️ BULLISH (green)
⬇️ BEARISH (red)
➖ NEUTRAL (grey)
This gives an instantaneous, screen‑wide readout of the current macro bias.
Active Indicator Toggles
Each of the five TA tools can be individually enabled/disabled. Disabling a tool removes its vote from the consensus, allowing you to back‑test which combination of indicators produces the most reliable signals.
📖 Interpretation Guide
Positive values (> 0) indicate that Bitcoin’s momentum (as measured by the selected TA tools) is stronger than Global Liquidity’s momentum. This implies that risk‑on appetite is prevailing, and Bitcoin is likely to outperform – a bullish signal for BTC.
Negative values (< 0) indicate that Global Liquidity is gaining momentum faster than Bitcoin. This often suggests tightening financial conditions or risk‑off sentiment, which tends to weigh on speculative assets – a bearish signal for BTC.
Magnitude matters: a score of +80 or ‑80 means nearly all indicators agree, signalling a strong consensus and potentially a sustained trend. Values near zero suggest indecision or mixed signals – caution is advised.
The Lag Effect:
If LIQ_Lag is set high (e.g., 101 bars), the indicator effectively asks: “Did liquidity conditions 101 bars ago predict where Bitcoin is today?”
A consistently positive consensus under this setup suggests liquidity leads Bitcoin, making the indicator a leading macro predictor.
Conversely, if BTC_Lag is positive, you are testing whether Bitcoin leads liquidity – a less common but insightful alternative.
Background colour provides a quick visual summary; green zones are favourable for long positions, red zones for shorts or hedges.
🚨 Alert Summary
Two straightforward alert conditions are built in for automation:
LONG – triggered when percentual_btc > 0 (consensus turns bullish).
SHORT – triggered when percentual_btc < 0 (consensus turns bearish).
Both alerts are available in the TradingView alerts panel. They are ideal for macro‑based entry signals, portfolio allocation shifts, or as a filter to confirm directional bias before taking a trade on BTC or related crypto assets.
Global Liquidity Indicators VS Bitcoin | TR is a macro‑economic divergence and consensus oscillator that compares Bitcoin's momentum against a composite Global Liquidity index. Instead of relying on a single metric, it aggregates up to five technical analysis tools (ROC, CCI, RSI, MFI, CMO) into a weighted voting system. The indicator applies user‑defined lags to both series, allowing traders to test leading/lagging relationships between liquidity conditions and Bitcoin price action. The final output is a normalised consensus score (‑100 to +100), displayed via dynamic background colouring, raw TA line overlays, and a prominent trend table for immediate directional bias.
⚙️ Core Calculations
Data Sourcing
The indicator requests closing prices from two custom tickers:
Bitcoin (BTC): INDEX:BTCUSD
Global Liquidity (LIQ): A composite basket defined as
TVC:CN10Y/TVC:DXY/FRED:BAMLH0A0HYM2*(ECONOMICS:USCBBS+FRED:JPNASSETS/FX:USDJPY+ECONOMICS:CNCBBS/FX_IDC:USDCNY+FRED:ECBASSETSW/FX_IDC:USDEUR)
This combines yield curves, FX rates, central bank balance sheets, and credit spreads into a single synthetic price series.
Technical Analysis Engine
For both BTC and LIQ, the indicator computes up to five separate momentum/oscillator values over user‑defined lengths:
ROC (Rate of Change) – default 90 for BTC, 63 for LIQ
CCI (Commodity Channel Index)
RSI (Relative Strength Index)
MFI (Money Flow Index)
CMO (Chande Momentum Oscillator)
Each TA variant is calculated independently, giving a multi‑faceted view of each asset’s internal momentum.
Lag Application
Every computed TA value is shifted by a user‑defined lag:
BTC_Lag (default 0) – shifts Bitcoin’s data forward/backward.
LIQ_Lag (default 101) – shifts Liquidity’s data.
This is the core differentiator: by applying a lag to Liquidity, the indicator can test whether past liquidity changes predict current Bitcoin moves (positive lag) or vice‑versa.
Binary Scoring & Consensus
For each enabled TA tool (enableROC, enableCCI, etc.), the indicator compares the lagged BTC value against the lagged LIQ value:
BTC > LIQ → score = +1 (bullish for BTC)
BTC < LIQ → score = -1 (bearish for BTC)
The total score is summed across all enabled indicators, then divided by the number of active tools (active) to produce an average:
text
percentual_btc = (sum_of_scores / active) * 100
The result ranges from ‑100 (all indicators favour Liquidity) to +100 (all indicators favour Bitcoin).
Primary TA Line (for visual plotting)
The user can select one TA type (TA input) to plot as the raw line overlay for both assets. This line is also shifted by its respective lag, allowing visual comparison of the chosen metric directly on the chart.
📈 Signal System
Trend Bias (Consensus)
Bullish Regime (Bull_BTC): percentual_btc > 0 → more than 50% of enabled indicators favour Bitcoin over Liquidity.
Bearish Regime (Bear_BTC): percentual_btc < 0 → more than 50% of enabled indicators favour Liquidity over Bitcoin.
Neutral: exactly 0 (rare, but possible when active is even and scores cancel out).
Crossing Zero
While not explicitly plotted as a crossover line, a shift from positive to negative (or vice‑versa) signals a change in the macro consensus – i.e., Liquidity is gaining/losing relative strength against Bitcoin.
Background Zone
The entire chart background is tinted:
Green (bullish) when consensus favours Bitcoin.
Red (bearish) when consensus favours Liquidity.
Transparency is fixed at 95%, keeping price action fully readable.
🎨 Visual Features
Primary TA Overlays
Two plotted lines (BTC in orange, LIQ in blue) display the user‑selected technical indicator (ROC, CCI, RSI, MFI, or CMO). Both respect their respective lag offsets, letting you visually assess divergences and crossovers.
9 Colour Themes
Choose from Classic, Modern, Heat, Robust, Accented, Monochrome, Moderate, Aqua, or Cosmic. These define the specific shades used for the bullish (UpC) and bearish (DnC) background fills and the trend table text.
Trend Table
A persistent, large‑font table positioned at the middle‑right of the chart displays:
⬆️ BULLISH (green)
⬇️ BEARISH (red)
➖ NEUTRAL (grey)
This gives an instantaneous, screen‑wide readout of the current macro bias.
Active Indicator Toggles
Each of the five TA tools can be individually enabled/disabled. Disabling a tool removes its vote from the consensus, allowing you to back‑test which combination of indicators produces the most reliable signals.
📖 Interpretation Guide
Positive values (> 0) indicate that Bitcoin’s momentum (as measured by the selected TA tools) is stronger than Global Liquidity’s momentum. This implies that risk‑on appetite is prevailing, and Bitcoin is likely to outperform – a bullish signal for BTC.
Negative values (< 0) indicate that Global Liquidity is gaining momentum faster than Bitcoin. This often suggests tightening financial conditions or risk‑off sentiment, which tends to weigh on speculative assets – a bearish signal for BTC.
Magnitude matters: a score of +80 or ‑80 means nearly all indicators agree, signalling a strong consensus and potentially a sustained trend. Values near zero suggest indecision or mixed signals – caution is advised.
The Lag Effect:
If LIQ_Lag is set high (e.g., 101 bars), the indicator effectively asks: “Did liquidity conditions 101 bars ago predict where Bitcoin is today?”
A consistently positive consensus under this setup suggests liquidity leads Bitcoin, making the indicator a leading macro predictor.
Conversely, if BTC_Lag is positive, you are testing whether Bitcoin leads liquidity – a less common but insightful alternative.
Background colour provides a quick visual summary; green zones are favourable for long positions, red zones for shorts or hedges.
🚨 Alert Summary
Two straightforward alert conditions are built in for automation:
LONG – triggered when percentual_btc > 0 (consensus turns bullish).
SHORT – triggered when percentual_btc < 0 (consensus turns bearish).
Both alerts are available in the TradingView alerts panel. They are ideal for macro‑based entry signals, portfolio allocation shifts, or as a filter to confirm directional bias before taking a trade on BTC or related crypto assets.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.