PROTECTED SOURCE SCRIPT
Logarithimic Regression Fib Deviation Bands

Overview
This indicator builds a logarithmic regression growth curve and wraps it in Fibonacci-scaled deviation bands to create a long-horizon valuation corridor. It is designed for assets where percentage moves matter more than absolute price moves (for example Bitcoin and other crypto assets), and it remains readable thanks to rainbow band colouring and right-offset labels.
What this indicator does
1) Fits a regression midline in log price space
2) Measures deviation around the midline
3) Builds Fibonacci-scaled deviation bands
4) Keeps the chart clean and readable
Why this indicator is useful
This tool is designed for context, structure, and regime awareness, not short-term entry signals.
How it works (plain English)
Inputs guide
Typical usage ideas
Notes and limitations
This indicator builds a logarithmic regression growth curve and wraps it in Fibonacci-scaled deviation bands to create a long-horizon valuation corridor. It is designed for assets where percentage moves matter more than absolute price moves (for example Bitcoin and other crypto assets), and it remains readable thanks to rainbow band colouring and right-offset labels.
What this indicator does
1) Fits a regression midline in log price space
- []The midline is a best-fit curve for the asset’s long-term trend
[]Because the regression is performed on log(price), the trend behaves in percentage terms rather than linear price terms - This makes the curve suitable for multi-cycle and exponential-growth markets
2) Measures deviation around the midline
- []The indicator calculates the residual distance between price and the regression midline in log space
[]A single expanding deviation measure is derived from these residuals
[]Deviation can be calculated using either:- []Expanding standard deviation (smoother, more robust)
- Expanding maximum deviation (widest possible corridor)
- []Expanding standard deviation (smoother, more robust)
3) Builds Fibonacci-scaled deviation bands
- []Upper and lower bands are placed at Fibonacci multiples of the deviation
[]Included levels:- []0.236, 0.382, 0.500, 0.618, 0.786
[]1.000, 1.272, 1.618, 1.786, 2.000
[]Extended levels above 2.0: 2.272, 2.414, 2.500, 2.618, 2.720, 3.000
- []0.236, 0.382, 0.500, 0.618, 0.786
4) Keeps the chart clean and readable
- []Upper bands have individual visibility toggles
[]Lower bands have:- []A master enable / disable switch
[]Individual per-level toggles
[]All labels are offset to the right so they do not overlap current price action - []A master enable / disable switch
Why this indicator is useful
This tool is designed for context, structure, and regime awareness, not short-term entry signals.
- []Long-term valuation context
Helps visualise where price sits relative to a fitted growth curve
[]Cycle extremes
Upper Fibonacci deviation bands highlight historically stretched conditions and potential blow-off zones
[]Mean-reversion and discount zones
Lower bands highlight historically depressed conditions and deep drawdown regions
[]Consistency across time
Because the model operates in log space, all distances are interpreted as percentages, making behaviour comparable across multiple cycles
How it works (plain English)
- []Price is converted to log(price)[]A regression is fitted to log(price) using an anchored time axis
[]Two time modes are available:
[]Days: log(price) vs linear time (exponential curve in price space)
[]Log(Days): log(price) vs log(time), which often behaves like a power-law corridor over very long histories
[]Residuals (distance from the midline) are measured in log space
[]A deviation width is calculated from those residuals
[]Fibonacci ratios are applied to that deviation to create the band levels - Bands are converted back to normal price and plotted
Inputs guide
- []Model timeframe
Regression and deviation are calculated on a chosen timeframe (default Daily) and displayed on all chart timeframes
[]Time axis mode- []Days = exponential-style trend
[]Log(Days) = power-law-style trend (often better for very long cycles)
- []Expanding StdDev = smoother, more statistically robust corridor
[]Expanding MaxAbs = widest possible corridor
Shifts the entire corridor up or down by a constant percentage (useful for centring the model across different assets)
[]Lower band controls
Master toggle plus per-level toggles allow you to show only the lower levels that are relevant for the current regime
[]Label offset
Moves labels into the future by a fixed number of bars so they do not interfere with live price action - []Days = exponential-style trend
Typical usage ideas
- []Use Log(Days) + Expanding StdDev as a default for multi-cycle assets
[]Treat upper bands as risk or stretch zones, not automatic sell signals
[]Treat lower bands as discount or stress zones, not automatic buy signals
[]Enable deeper lower bands only when price action approaches those regions
Notes and limitations
- []This indicator is not a prediction tool[]Bands evolve as more historical data becomes available
- Results may vary depending on the amount and quality of historical data for a given symbol
Script protegido
Esse script é publicada como código fechado. No entanto, você pode gerenciar suas escolhas de bate-papo. Por favor, abra suas Configurações do perfil
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode gerenciar suas escolhas de bate-papo. Por favor, abra suas Configurações do perfil
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.