OPEN-SOURCE SCRIPT

RichmondHillCM - Log-Price Regression Channel V1.2

401
RichmondHillCM - Log-Price Regression Channel V1.2

An OLS linear regression fitted to the logarithm of price, with standard-deviation bands (±1σ / ±2σ / ±3σ) projected around the fitted mean. Because the fit is done in log-space, the channel is geometric — it scales proportionally across very different price levels, which makes it well suited to long-trending instruments like SPY where a raw-price channel would distort.
⚠️ Designed for the WEEKLY (1W) timeframe. The default 252-bar lookback (~5 years of weekly data) and the band logic are tuned for weekly candles. A live banner at the top of the stats table turns red whenever the chart is not on a weekly timeframe.

Features

Log-space regression mean + ±1σ/±2σ/±3σ bands with optional fills
BUY / SELL labels on ±2σ crosses, optional STRONG BUY / SELL on ±3σ
Stats table: each band's price, % distance from current price, and Z-score
Background shading when price is stretched beyond ±2σ / ±3σ
Built-in alert conditions for every band cross and the mean

How to use

Best suited to long-term growth compounders like Google (GOOGL, SPY, NDX). Use it on the weekly (1W) timeframe and set your price axis to logarithmic scale for the bands to line up correctly.

Instrument: growth compounders / steady long-term trenders (e.g. GOOGL, MSFT, SPY)
Timeframe: weekly (1W)
Price axis: log scale (right-click the axis → "Logarithmic")

How to read it: price drifting toward ±2σ/±3σ is unusually far from its own trend; the bands act like a statistical rubber band. Use band touches as context, not standalone entries.


For research and educational purposes only. Not financial advice.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.