OPEN-SOURCE SCRIPT

Bitcoin (BTC) Electrical Cost [R2D2]

57
Bitcoin Electrical Cost Ribbon [R2D2]

Description
"Bitcoin bottoms don't happen when people feel good. They happen when selling becomes impossible."

This script replicates the famous "Bitcoin Production Cost" and "Energy Value" models popularized by Charles Edwards (Capriole Investments) and frequently cited by analysts like Black Swan. It provides a structural valuation of Bitcoin based on the thermodynamics of Proof-of-Work: Energy.

This indicator visualizes the Miner Profitability Ribbon, helping you identify generational bottoms where Bitcoin's price touches its raw electrical production cost.

How It Works
Bitcoin is an industrial network. To produce one coin requires a tangible amount of electricity (Joules). This script calculates that cost using Mining Difficulty as a proxy for the network's total energy expenditure.

The Red Floor (Electrical Cost):

This is the estimated raw electricity bill to mine 1 BTC.

The Logic: When price drops below this line, the average miner is operating at a cash-flow loss. They are forced to shut down rigs or sell reserves to pay bills. This creates "Miner Capitulation."

The Signal: Historically, Bitcoin price only touches this red line during the deepest phase of a Bear Market (e.g., 2018 bottom, 2022 bottom). It acts as a hard "fundamental floor" because selling below this price destroys the miners themselves.

The Ribbon (Profitability Zone):

The area between the Red Floor and the Grey Ceiling represents the miner's operational margin (CapEx + OpEx).

When price is above the ribbon, miners are profitable and expanding.

When price is inside the ribbon, margins are compressing.

Settings & Calibration
Difficulty Source: The script attempts to pull QUANDL:BCHAIN/DIFF automatically. If you are on a free plan without access to this data, the script features a smart "Fallback Model" that mathematically estimates the difficulty curve so the indicator always works.

Electrical Multiplier:
Default is set to 465. This is calibrated for the 2026 era (Difficulty ~125T ≈ $58k Cost). You can adjust this slightly as global energy prices or hardware efficiency changes.

Smoothing: Includes a built-in Moving Average (SMA 21) to remove the "staircase" effect of difficulty adjustments, giving you the clean, wave-like aesthetic seen in professional macro charts.

How to Trade This Indicator
The "All-In" Signal: Watch for the price to aggressively drop into the Red Ribbon. A daily or weekly close on or slightly below the Red Electrical Cost line has historically marked the absolute bottom of the cycle.

Trend Confirmation: During a Bull Market, this ribbon should slope upwards. If the ribbon flattens or curls down, it indicates hashrate is leaving the network (miner stress).

Disclaimer
This tool is for educational purposes and analyzes on-chain network fundamentals. It is not financial advice. Mining costs are estimates based on global averages; individual miner costs vary wildly based on electricity rates and hardware efficiency.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.