OPEN-SOURCE SCRIPT
Bitcoin Logarithmic Regression Oscillator

Overview
The Bitcoin Logarithmic Regression Oscillator (BLR Osc.) is an analytical tool designed to measure Bitcoin's price deviation from its historical logarithmic growth curve. By comparing the current price to a mathematical "fair value," this indicator helps traders and investors identify macroeconomic accumulation zones and potential market cycle peaks.
How it Works
Historically, Bitcoin's price action has followed a non-linear, logarithmic growth trajectory where the rate of growth slows down over time. This script calculates a theoretical "fair value" based on the number of days since the first available price data, using the following logarithmic regression model:
Pine Script®
The oscillator at the bottom of the chart represents the natural logarithm of the ratio between the current closing price and this fair valuePine Script®
How to Use
Monitor the oscillator in the lower pane to gauge the current stage of the market cycle. When the oscillator drops below the user-defined Buy Threshold (default is -0.50), the script highlights these undervalued zones by turning both the oscillator line and the price line green.
💡 Visualization Tip:
Curve Calibration & Customization
The default mathematical coefficients provided in this script are based on an approximation fitted on March 30, 2026 (with an R² = 0.9720).
Because the logarithmic curve requires periodic recalibration as new market data emerges, advanced users can perform their own mathematical approximations. You can easily update the coefficients by entering your new a (slope), b (intercept), and offset (days) values directly into the indicator's settings menu under the "Logarithmic Regression" group. There is no need to edit the source code.
The Bitcoin Logarithmic Regression Oscillator (BLR Osc.) is an analytical tool designed to measure Bitcoin's price deviation from its historical logarithmic growth curve. By comparing the current price to a mathematical "fair value," this indicator helps traders and investors identify macroeconomic accumulation zones and potential market cycle peaks.
How it Works
Historically, Bitcoin's price action has followed a non-linear, logarithmic growth trajectory where the rate of growth slows down over time. This script calculates a theoretical "fair value" based on the number of days since the first available price data, using the following logarithmic regression model:
The oscillator at the bottom of the chart represents the natural logarithm of the ratio between the current closing price and this fair value
- A value of 0 means the price is exactly at its fair value.
- Positive values indicate overvaluation and potential market exuberance (cycle tops).
- Negative values highlight undervaluation and accumulation phases (bear market bottoms).
How to Use
Monitor the oscillator in the lower pane to gauge the current stage of the market cycle. When the oscillator drops below the user-defined Buy Threshold (default is -0.50), the script highlights these undervalued zones by turning both the oscillator line and the price line green.
💡 Visualization Tip:
- If you want to see the regression curve and colored line on your main chart pane more clearly, you can hide the default standard Bitcoin candles using the chart's object tree/settings.
- Conversely, if you only want to use the oscillator in the lower pane and keep your main chart clean, simply uncheck the "Plot on the Main Pane" option in the indicator's settings.
Curve Calibration & Customization
The default mathematical coefficients provided in this script are based on an approximation fitted on March 30, 2026 (with an R² = 0.9720).
Because the logarithmic curve requires periodic recalibration as new market data emerges, advanced users can perform their own mathematical approximations. You can easily update the coefficients by entering your new a (slope), b (intercept), and offset (days) values directly into the indicator's settings menu under the "Logarithmic Regression" group. There is no need to edit the source code.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.