OPEN-SOURCE SCRIPT

Bitcoin Stock-to-Flow Model Price Bands

275
# Bitcoin Stock-to-Flow Model Price Bands

Overview
This indicator implements the famous Stock-to-Flow (S2F) model created by PlanB (@100trillionUSD), which uses Bitcoin's scarcity to predict its long-term value. The S2F model has gained significant attention for its historical accuracy in capturing Bitcoin's price movements across multiple market cycles.

What is Stock-to-Flow?
Stock-to-Flow is a ratio that measures scarcity by dividing the current supply (stock) by the annual production (flow). The model suggests that as Bitcoin becomes scarcer through halving events, its value should increase proportionally.

This indicator features:

Dynamic S2F Calculation
- Automatically calculates Bitcoin's current supply based on block height
- Adjusts for halving events (every 210,000 blocks)
- Updates the S2F ratio in real-time

Visual Elements
- Orange Line: S2F model price based on the formula: Price = 0.4 × S2F³
- Confidence Bands: Upper (red) and lower (green) bands showing expected price ranges
- Colored Candles: Green when above model price, red when below
- Info Table: Displays current S2F ratio, model price, actual price, and price multiple

Customizable Parameters
- Model Coefficient: Adjust the multiplier (default: 0.4)
- Model Exponent: Modify the power factor (default: 3.0)
- Band Width: Control confidence band spread (1-5 standard deviations)
- Display Options: Toggle individual elements on/off

Built-in Alerts
- Price crossing above/below S2F model price
- Price exceeding upper/lower confidence bands

How to Use

1. Trend Identification: When price is above the orange S2F line, Bitcoin may be overvalued; below suggests undervaluation
2. Cycle Analysis: The model steps up at each halving, creating distinct price "floors"
3. Risk Management: Use confidence bands to identify extreme deviations from the model
4. Long-term Perspective: Best suited for macro analysis rather than short-term trading

Important to understand:

This is a model, not a guarantee. The S2F model:
- Assumes scarcity is the primary driver of value
- Doesn't account for demand-side factors
- Has shown deviations during certain market conditions
- Should be used alongside other analysis methods

Model Performance

Historically, the S2F model has captured major Bitcoin price movements:
- 2013 Bull Run: Price followed model predictions
- 2017 Peak: Reached model targets
- 2021 Cycle: Initially tracked, then deviated
- 2024-2025: Model suggests $500k-$1M potential

Technical Details

- Uses logarithmic regression similar to the original S2F model
- Accounts for "lost" coins (est. 1M BTC from early mining)
- Implements dynamic supply calculation through halving cycles
- Confidence bands use log-normal distribution

Best Timeframes
- Weekly/Monthly: Ideal for long-term trend analysis

Credits
Based on the Stock-to-Flow model by PlanB (@100trillionUSD)
Original article: "Modeling Bitcoin's Value with Scarcity" (2019)

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.