OPEN-SOURCE SCRIPT
SD Median NUPL-Z

🧠 Overview
SD Median NUPL-Z is a trend-following indicator that leverages a normalized version of Bitcoin’s Net Unrealized Profit/Loss (NUPL) metric, filtered through a median-based volatility band. Unlike traditional NUPL which is often used to spot extremes, this indicator is designed to identify sustained directional trends — entering only when both on-chain momentum and price structure align.
🧩 Key Features
🔍 How It Works
Signal Logic:
🔁 Use Cases & Applications
✅ Conclusion
SD Median NUPL-Z repurposes a traditionally cyclical valuation tool into a modern trend-following signal by combining statistical normalization with dynamic price structure filtering. It offers a more robust way to participate in high-conviction directional trends, reducing the likelihood of entering during short-lived counter moves.
⚠️ Disclaimer
The content provided by this indicator is for educational and informational purposes only. Nothing herein constitutes financial or investment advice. Trading and investing involve risk, including the potential loss of capital. Always backtest and apply risk management suited to your strategy.
SD Median NUPL-Z is a trend-following indicator that leverages a normalized version of Bitcoin’s Net Unrealized Profit/Loss (NUPL) metric, filtered through a median-based volatility band. Unlike traditional NUPL which is often used to spot extremes, this indicator is designed to identify sustained directional trends — entering only when both on-chain momentum and price structure align.
🧩 Key Features
- Z-Scored NUPL Trend Engine: Normalizes NUPL using rolling mean and standard deviation to create a smoothed trend signal.
- Price Structure Filter: Implements a median-based price band to avoid false entries during short-term volatility.
- Custom Thresholds: User-defined thresholds determine when the trend signal is strong enough to justify a long or short directional bias.
- Directional Candle Coloring: Reinforces current trend regime visually with aqua (bullish) and red (bearish) plots and candles.
- Optimized for BTC: Uses Bitcoin’s Market Cap and Realized Cap to construct the NUPL input.
🔍 How It Works
- On-Chain Core: NUPL is calculated as the percentage of unrealized profit in the market: (Market Cap - Realized Cap) / Market Cap * 100.
- Z-Score Transformation: The raw NUPL value is normalized using a rolling average and standard deviation over a set window (default 134 days), producing the NUPL-Z series.
- Median-Based Price Filter: A rolling 50th percentile (median) of price is used alongside its own standard deviation to create upper and lower bounds.
These bounds define a "volatility corridor" around price; the trend signal is only acted upon if price confirms by staying outside these bands.
Signal Logic:
- A Long signal is triggered when NUPL-Z rises above the long threshold and price is not below the lower band.
- A Short signal is triggered when NUPL-Z falls below the short threshold.
- State Variable (CD): Tracks the current market regime, used to control plotting and color changes.
🔁 Use Cases & Applications
- Momentum-Based Trend Following: Helps traders align with directional moves backed by both on-chain sentiment and supportive price structure.
- Filtered Entry Timing: Reduces premature or noise-based entries by requiring price confirmation before committing to NUPL-based signals.
- Best Suited for BTC: This tool is designed specifically around Bitcoin’s on-chain metrics and is not intended for altcoins or low-volume assets.
✅ Conclusion
SD Median NUPL-Z repurposes a traditionally cyclical valuation tool into a modern trend-following signal by combining statistical normalization with dynamic price structure filtering. It offers a more robust way to participate in high-conviction directional trends, reducing the likelihood of entering during short-lived counter moves.
⚠️ Disclaimer
The content provided by this indicator is for educational and informational purposes only. Nothing herein constitutes financial or investment advice. Trading and investing involve risk, including the potential loss of capital. Always backtest and apply risk management suited to your strategy.
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.
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 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.
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.