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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.