OPEN-SOURCE SCRIPT
RHODL Z-Score [TheSnake3Run]

The original RHODL Ratio, created by Philip Swift, is an on-chain metric that compares the cost basis of coins last moved in the past week against the cost basis of coins last moved 1–2 years ago, weighted by total market age. It identifies macro cycle tops and bottoms in Bitcoin. The true metric requires UTXO-level realized-cap data not available inside Pine Script, so this indicator approximates the dynamic using price alone and standardises the output as a z-score.
How the calculation works
1. Short cohort — 7-bar SMA of price (≈ 1 week on daily). Proxy for recently-transacted cost basis.
2. Long cohort — SMA of price from 365 to 730 bars ago (≈ 1–2 years back). Proxy for long-term holder cost basis.
3. Ratio — short ÷ long. Above 1 means recent price is elevated versus long-term basis.
4. Age weighting — ratio × bar index, mirroring RHODL's market-age adjustment, then log-transformed.
5. Z-score — the log value is normalised against its own 365-bar rolling mean and standard deviation. The plot shows how many standard deviations the current reading sits from its one-year average.
How to read it
Above +2 — stretched high; overheated. Shaded red.
−1 to +1 — normal range.
Below −2 — stretched low; accumulation. Shaded green.
How the calculation works
1. Short cohort — 7-bar SMA of price (≈ 1 week on daily). Proxy for recently-transacted cost basis.
2. Long cohort — SMA of price from 365 to 730 bars ago (≈ 1–2 years back). Proxy for long-term holder cost basis.
3. Ratio — short ÷ long. Above 1 means recent price is elevated versus long-term basis.
4. Age weighting — ratio × bar index, mirroring RHODL's market-age adjustment, then log-transformed.
5. Z-score — the log value is normalised against its own 365-bar rolling mean and standard deviation. The plot shows how many standard deviations the current reading sits from its one-year average.
How to read it
Above +2 — stretched high; overheated. Shaded red.
−1 to +1 — normal range.
Below −2 — stretched low; accumulation. Shaded green.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.