OPEN-SOURCE SCRIPT

Bitcoin Transaction Fees Z-Score | Astral Vision

306
Bitcoin Transaction Fees Z-Score | Astral Vision 🌠💠

Transaction fees are one of the most direct expressions of genuine on-chain demand pressure. When users compete to get transactions confirmed, fees spike and historically those spikes have aligned tightly with late-stage cycle euphoria. Conversely, fee compression marks periods of network inactivity that have repeatedly preceded major accumulation opportunities.

This indicator standardizes total Bitcoin transaction fees (USD) in log space over a configurable lookback window, producing a Z-Score that exposes statistically extreme deviations from the long-term fee baseline, both to the upside and the downside.

Calculation ⚙️

`Z = (log(SMA(Total Fees USD, smooth)) − SMA(log_fees, length)) / StdDev(log_fees, length)`

Total on-chain fees in USD are first smoothed by a short SMA to reduce daily noise, then transformed into log space before standardization. The Z-Score measures how many standard deviations the current fee level sits above or below its long-term mean, compressing Bitcoin's exponential fee growth into a cycle-comparable signal.

Plots 📊
  • Z-Score line, colored by active regime (positive, negative, or neutral)
  • Extreme High threshold line (default 2.5)
  • Low threshold line (default −1.35)
  • Fill between Z-Score and Extreme High threshold when breached (distribution zone)
  • Fill between Z-Score and Low threshold when breached (accumulation zone)
  • Candle coloring on the price chart by active regime
  • Background highlight on the price chart when either threshold is active


Inputs 🎛️
  • `Z-Score Length (days)`: lookback window for mean and standard deviation calculation (default 730)
  • `Smooth Input (days)` : SMA applied to raw fee data before log transformation (default 7)
  • `Extreme High Threshold` : Z-Score level marking fee-driven distribution zones (default 2.5)
  • `Low Threshold` : Z-Score level marking fee-driven accumulation zones (default −1.35)


Colors 🎨

5 Astral Vision presets + custom override. Default: Futura. Positive color activates below the Low threshold; negative color activates above the Extreme High threshold; neutral applies between thresholds.

Purpose 🎯

Raw fee charts are dominated by Bitcoin's exponential price growth, making cycle-to-cycle comparison visually meaningless. Standard fee indicators plot absolute values with no statistical context, offering no signal on whether current fees are elevated or compressed relative to historical norms.

This indicator solves both problems: log transformation removes the exponential trend, and Z-Score standardization makes every cycle directly comparable regardless of Bitcoin's price magnitude. The result is a clean, threshold-driven signal that identifies when fee demand has reached statistically extreme levels, either as a distribution warning or an accumulation opportunity, directly overlaid on the price chart through candle and background coloring.

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.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。