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 de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.