OPEN-SOURCE SCRIPT
Log Regression Channel (1000 Bars)

This indicator fits a linear regression to the natural log of price over a configurable lookback (default 1000 bars), then plots the resulting trend line along with standard deviation bands above and below it.
Working in log space rather than raw price means the fit follows percentage-based (exponential) growth, which suits assets that compound over time. The center line represents the statistical trend over the lookback window. The inner bands sit at 1 standard deviation of the regression residuals, and the outer bands at 2 standard deviations, giving a sense of how stretched price is relative to its own trend: near the upper bands is historically extended, near the lower bands is historically compressed.
How it works:
- Computes a least-squares linear regression on log(price) across the lookback window
- Measures the standard deviation of the residuals (how far price typically strays from the fit)
- Draws the center line plus inner (1 SD) and outer (2 SD) bands, extended to the right
- Auto-adapts to each symbol and timeframe; bars with missing or non-positive prices are skipped so it renders across a wide range of assets
Inputs:
- Lookback length (number of bars used in the fit)
- Source
- Inner and outer band multipliers (default 1 and 2 standard deviations)
- Editable colors and line widths for the center line and each band set
How to use:
View on a log-scaled chart for correct interpretation (the channel is fit in log space). Higher timeframes describe a longer-term trend; lower timeframes describe a shorter one. Most meaningful on assets with a persistent growth trend, and less informative on flat, range-bound, or structurally declining markets. Best used as one input among several rather than a standalone signal.
Working in log space rather than raw price means the fit follows percentage-based (exponential) growth, which suits assets that compound over time. The center line represents the statistical trend over the lookback window. The inner bands sit at 1 standard deviation of the regression residuals, and the outer bands at 2 standard deviations, giving a sense of how stretched price is relative to its own trend: near the upper bands is historically extended, near the lower bands is historically compressed.
How it works:
- Computes a least-squares linear regression on log(price) across the lookback window
- Measures the standard deviation of the residuals (how far price typically strays from the fit)
- Draws the center line plus inner (1 SD) and outer (2 SD) bands, extended to the right
- Auto-adapts to each symbol and timeframe; bars with missing or non-positive prices are skipped so it renders across a wide range of assets
Inputs:
- Lookback length (number of bars used in the fit)
- Source
- Inner and outer band multipliers (default 1 and 2 standard deviations)
- Editable colors and line widths for the center line and each band set
How to use:
View on a log-scaled chart for correct interpretation (the channel is fit in log space). Higher timeframes describe a longer-term trend; lower timeframes describe a shorter one. Most meaningful on assets with a persistent growth trend, and less informative on flat, range-bound, or structurally declining markets. Best used as one input among several rather than a standalone signal.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.