OPEN-SOURCE SCRIPT

Short-Term Holder MVRV

86
This script calculates and visualizes the Market Value to Realized Value (MVRV) ratio for Bitcoin, specifically focusing on short-term holders (STH). The MVRV ratio is a key on-chain metric that compares Bitcoin's market cap to its realized cap (the aggregate cost basis of all coins). It helps traders identify overbought and oversold conditions in the market.

Key Features
1. Moving Averages (Customizable)
The script allows users to apply different moving averages to smooth the MVRV data:

EMA (Exponential Moving Average)

SMA (Simple Moving Average)

SMMA/RMA (Smoothed/Rolling Moving Average)

WMA (Weighted Moving Average)

VWMA (Volume-Weighted Moving Average)

HMA (Hull Moving Average)

2. Core Calculation
Fetches BTC_MVRV data from TradingView's security function.

Computes a moving average (default: 238-period WMA) of the MVRV values.

Calculates the Ratio_MVRV as:

text
Ratio_MVRV = Current MVRV / Moving Average of MVRV
A bullish signal is generated when Ratio_MVRV > 1 (market is heating up).

A bearish signal is generated when Ratio_MVRV < 1 (market is cooling down).

3. Visual Output
Main Plot:

A line chart showing Ratio_MVRV.

Orange when bullish (Ratio_MVRV > 1).

Purple when bearish (Ratio_MVRV < 1).

Horizontal Line:

A dotted white line at 1.0, acting as a threshold.

Table Display:

A small table in the top-right corner showing "↑ Bull" (green) or "↓ Bear" (red) based on the current market state.

4. Alerts
Triggers TradingView alerts when the market state changes between bullish and bearish.

Interpretation & Trading Signals
When Ratio_MVRV > 1 (Bullish):

Suggests Bitcoin is gaining momentum, possibly entering an overbought phase.

Could indicate a good time to hold or accumulate, but extreme highs may signal a potential top.

When Ratio_MVRV < 1 (Bearish):

Suggests Bitcoin is undervalued, possibly in an oversold phase.

Could indicate a buying opportunity, but prolonged lows may signal further downside.

Default Settings & Customization
Length: 238 (adjustable, default based on common long-term trend analysis).

Moving Average Type: WMA (Weighted Moving Average).

Users can modify these settings in the Inputs menu in TradingView.

Use Case
Helps traders identify market cycles by tracking short-term holder behavior.

Works best as a confirmation tool alongside other indicators (e.g., RSI, MACD).

Useful for swing traders and long-term investors looking for trend reversals.

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.