OPEN-SOURCE SCRIPT

Bitcoin Yardstick Valuation And Trend | Astral Vision

634
Bitcoin Yardstick Valuation and Trend | Astral Vision 🌠💠

The Bitcoin Yardstick divides market capitalization by hashrate, producing a ratio that expresses how much the market is paying per unit of computational security the network provides.
When this ratio is elevated, Bitcoin is expensive relative to the mining power securing it, a condition historically associated with speculative excess.
When compressed, the market is undervaluing the network relative to its security infrastructure, historically marking accumulation opportunities.

This indicator standardizes the Yardstick in log space over a rolling window, producing a Z-Score that makes cycle-to-cycle comparisons statistically rigorous regardless of Bitcoin's absolute price or the long-term growth of hashrate.
Two visualization modes expose different analytical perspectives on the same signal:
  • "Extremes" identifies statistically significant deviations from the mean with color-coded severity levels.
  • "Trend" tracks the direction of the smoothed signal's slope to identify momentum shifts before they reach extreme territory.


Calculation ⚙️

`Yardstick = Market Cap / Hashrate`

`Z-Score = (log(Yardstick) − SMA(log(Yardstick), window)) / StdDev(log(Yardstick), window)`

The Z-Score is then smoothed with a 50-bar EMA for the Trend mode, and its slope is computed over a configurable lookback to determine directional momentum.

Plots 📊
  • Z-Score line in the indicator panel with threshold fills at +2σ, +3σ and −2σ (Extremes mode)
  • Smoothed EMA of the Z-Score (Trend mode)
  • +3σ, +2σ, −2σ reference lines and zero mean line (Extremes mode)
  • Candle coloring on the price chart by active regime in both modes
  • Background highlight on the price chart at +3σ and −2σ extremes (Extremes mode)


Inputs 🎛️
  • `Z-Score Window (bars)`: rolling lookback for mean and standard deviation calculation
  • `Slope Length`: bar offset for EMA slope computation in Trend mode
  • `Visualization Mode`: Extremes (threshold-based severity coloring) or Trend (slope-based directional coloring)


Colors 🎨

5 Astral Vision presets + custom override for Trend mode. Default: Paradiso. In Extremes mode, a fixed independent color scale applies: orange at +2σ, red at +3σ, blue at −2σ. In Trend mode, positive color applies when the EMA slope is rising and negative when falling.

Purpose 🎯

Standard Yardstick implementations plot the raw ratio as an absolute value, which grows monotonically over time as both market cap and hashrate expand, making visual cycle comparison across different price epochs unreliable.
Log transformation and Z-Score standardization solve this by expressing the current ratio purely as a deviation from its own rolling norm, keeping every cycle on the same statistical scale.

The dual-mode structure separates two distinct use cases: Extremes is suited for identifying macro cycle tops and bottoms where the Yardstick has reached historically rare territory, while Trend provides an earlier directional signal based on the momentum of the smoothed Z-Score before any threshold is breached.
Disclaimer ⭕️

It is not financial advice, not an investment recommendation, and not affiliated with any financial institution, research firm, or organization of any kind. All content is provided for educational and informational purposes only. Always conduct your own research before making any financial decision.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.