OPEN-SOURCE SCRIPT

UM-Optimized Linear Regression Channel

531
DESCRIPTION
This indicator was inspired by Dr. Stoxx at drstoxx.com. Shout out to him and his services for introducing me to this idea. This indicator is a slightly different take on the standard linear regression indicator.

It uses two standard deviations to draw bands and dynamically attempts to best-fit the data lookback period using an R-squared statistical measure. The R-squared value ranges between zero and one with zero being no fit to the data at all and 1 being a 100% match of the data to linear regression line. The R-squared calculation is weighted exponentially to give more weight to the most recent data.

The label provides the number of periods identified as the optimal best-fit period, the type of loopback period determination (Manual or Auto) and the R-squared value (0-100, 100% being a perfect fit). >=90% is a great fit of the data to the regression line. <50% is a difficult fit and more or less considered random data.

The lookback mode can also be set manually and defaults to a value of 100 periods.

DEFAULTS
The defaults are 1.5 and 2.0 for standard deviation. This creates 2 bands above and below the regression line. The default mode for best-fit determination with "Auto" selected in the dropdown. When manual mode is selected, the default is 100. The modes, manual lookback periods, colors, and standard deviations are user-configurable.

HOW TO USE
Overlay this indicator on any chart of any timeframe. Look for turning points at extremes in the upper and lower bands. Look for crossovers of the centerline. Look at the Auto-determination for best fit. Compare this to your favorite Manual mode setting (Manual Mode is set to 100 by default lookback periods.)

When price is at an extreme, look for turnarounds or reversals. Use your favorite indicators, in addition to this indicator, to determine reversals. Try this indicator against your favorite securities and timeframes.

CHART EXAMPLE
The chart I used for an example is the daily chart of IWM. I illustrated the extremes with white text. This is where I consider proactively exiting an existing position and/or begin looking for a reversal.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.