PROTECTED SOURCE SCRIPT
BTC Regime Phase [HY|YC|GLI]

The correlation between global liquidity and
BTCUSD has attracted a lot of attention. Building on this insight, I developed an indicator that not only tracks global liquidity but also integrates the high‑yield spread and yield‑curve slope to capture credit risk and growth expectations.
Essence and Logic
At its core, the Risk‑On Composite Z‑Score converts three macro factors global liquidity momentum, the US high‑yield spread and the slope of the US yield curve into standardized Z‑scores, weights them, and tracks moving‑average crossovers. Each factor has a rationale: high‑yield spreads are powerful business‑cycle indicators and often outperform other financial variables (Gertler & Lown, 2000). Yield‑curve steepness reflects investor optimism and prompts shifts toward riskier assets global liquidity drives cross‑border flows and risk sentiment (Goldberg, 2023; Lee, 2024). Combining these measures gives a composite signal that has historically aligned well with Bitcoin’s tops and bottoms. Usable also for other crypto coins:
ETHUSD
SOLUSD
LINKUSD
Limitations and My Current Model Outlook
I want to be transparent: the three model sections are highly correlated. Currently, the high‑yield spread and yield curve data come only from the US; I may add Euro or Japanese spreads later. I’m also aware that macro dynamics are evolving. Fiscal policy and political choices could shorten bear markets and make the current sell signals less relevant. In a stagflationary world, inflation‑adjusted liquidity may swing more violently and require an asset‑inflation adjustment. Yet, the model has captured Bitcoin’s tops and bottoms almost to the week—future patterns may rhyme, not repeat.
Questions and Ideas:
The indicator is free to use. If it brings you value, you’re welcome to follow for updates. I appreciate your support and feedback. When you are interested in the source code, feel free to contact me for more details. When you feel like supporting me with some sats, contact me and I will give you a Lightning address. I am a student and that would help a lot – but please only if you can afford it!
♡ Thanks to everyone who contributes insight on TradingView ♡
© Robinhodl21
Features: Users can enable or disable each component, adjust weights and choose a short‑tenor (1‑year or 2‑year) for the yield curve. The script automatically scales lookback windows based on the chart timeframe (daily, weekly or monthly). It offers visual plots of each Z‑score, the composite score, and smoothed moving averages, with background colours highlighting regimes and markers for entries and exits. Trade logic includes optional dip‑buy triggers when the composite falls below a threshold, Friday‑only execution on daily charts to reduce whipsaws. A trend table summarises current Z‑scores and their trends. Settings are tuned for BTC weekly data but should be adjusted for other assets or timeframes. Because some inputs (e.g., GLI weights) have limited historical data, long backtests may be less reliable when using on other Risk On Assets like
NDX
COPPER
‼ Disclaimer: This indicator is for educational purposes and does not constitute investment advice. Markets involve risk; past performance is not indicative of future results. Users should not rely solely on this script for trading decisions. Always test and adapt settings to your asset, timeframe and risk tolerance. The author assumes no liability for any trading losses.
Literature:
Essence and Logic
At its core, the Risk‑On Composite Z‑Score converts three macro factors global liquidity momentum, the US high‑yield spread and the slope of the US yield curve into standardized Z‑scores, weights them, and tracks moving‑average crossovers. Each factor has a rationale: high‑yield spreads are powerful business‑cycle indicators and often outperform other financial variables (Gertler & Lown, 2000). Yield‑curve steepness reflects investor optimism and prompts shifts toward riskier assets global liquidity drives cross‑border flows and risk sentiment (Goldberg, 2023; Lee, 2024). Combining these measures gives a composite signal that has historically aligned well with Bitcoin’s tops and bottoms. Usable also for other crypto coins:
Limitations and My Current Model Outlook
I want to be transparent: the three model sections are highly correlated. Currently, the high‑yield spread and yield curve data come only from the US; I may add Euro or Japanese spreads later. I’m also aware that macro dynamics are evolving. Fiscal policy and political choices could shorten bear markets and make the current sell signals less relevant. In a stagflationary world, inflation‑adjusted liquidity may swing more violently and require an asset‑inflation adjustment. Yet, the model has captured Bitcoin’s tops and bottoms almost to the week—future patterns may rhyme, not repeat.
Questions and Ideas:
- Do you think this model will still be useful as fiscal and monetary regimes shift?
- Should I add a stagnation modulation perhaps real yields or inflation‑adjusted liquidity—to better capture a stagflation scenario?
- Are there high‑yield spreads on TV beyond the US that I should include? (Euro and Japan indices do exist.)
- Would it make sense to incorporate Bitcoin halving events or a stock‑to‑flow module?
The indicator is free to use. If it brings you value, you’re welcome to follow for updates. I appreciate your support and feedback. When you are interested in the source code, feel free to contact me for more details. When you feel like supporting me with some sats, contact me and I will give you a Lightning address. I am a student and that would help a lot – but please only if you can afford it!
♡ Thanks to everyone who contributes insight on TradingView ♡
© Robinhodl21
Features: Users can enable or disable each component, adjust weights and choose a short‑tenor (1‑year or 2‑year) for the yield curve. The script automatically scales lookback windows based on the chart timeframe (daily, weekly or monthly). It offers visual plots of each Z‑score, the composite score, and smoothed moving averages, with background colours highlighting regimes and markers for entries and exits. Trade logic includes optional dip‑buy triggers when the composite falls below a threshold, Friday‑only execution on daily charts to reduce whipsaws. A trend table summarises current Z‑scores and their trends. Settings are tuned for BTC weekly data but should be adjusted for other assets or timeframes. Because some inputs (e.g., GLI weights) have limited historical data, long backtests may be less reliable when using on other Risk On Assets like
‼ Disclaimer: This indicator is for educational purposes and does not constitute investment advice. Markets involve risk; past performance is not indicative of future results. Users should not rely solely on this script for trading decisions. Always test and adapt settings to your asset, timeframe and risk tolerance. The author assumes no liability for any trading losses.
Literature:
- Gertler, M., & Lown, C. S. (2000). The information in the high yield bond spread for the business cycle: Evidence and some implications. NBER Working Paper 7549.
- Lee, B. (2024). Staying ahead of the yield curve. CME Group.
- McCauley, R. N. (2012). Risk‑on/risk‑off, capital flows, leverage and safe assets. BIS Working Paper 382.
- Goldberg, L. (2023). Global liquidity: Drivers, volatility and toolkits. Federal Reserve Bank of New York Staff Report 1064.
- FRED (2025). ICE BofA Euro High Yield Index Option‑Adjusted Spread (BAMLHE00EHYIOAS). St. Louis Fed Data.
- Office of Financial Research (2025). Financial Stress Index sources: High yield indices..
- Tashev, T. (2025). The Bitcoin Stock‑to‑Flow Model: A comprehensive guide. Webopedia.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.