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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.