+1 888 340 6572

# Miscellaneous > SEB R - Squared

Article/Author: "Standard Error Bands" Jon Anderson, Stocks&Commodities Magazine, Traders Tips, 09/1996

File Includes:

Indicator - SEB R - Squared
Function - NewCoeffR

Category: Miscellaneous > SEB R - Squared

Description:

One tool available in forecasting the trendiness of the breakout is the coefficient of determination (R-squared), a statistical measurement.

The R-squared indicates linear strength between the security's price (the Y - axis) and time (the X - axis). The R-squared is the percentage of squared error that the linear regression can eliminate if it were used as the predictor instead of the mean value. If the R-squared were 0.99, then the linear regression would eliminate 99% of the error for prediction versus predicting closing prices using a simple moving average.

Usage:

When the R-squared is at an extreme low, indicating that the mean is a better predictor than regression, it can only increase, indicating that the regression is becoming a better predictor than the mean. The opposite is true for extreme high values of the R-squared.

Inputs:

Lenght - number of bars to calculate moment correlation coefficient R
Smooth - nimber of bars to calculate average R-square

EasyLanguage Code:
```INPUTS: LENGTH(21), SMOOTH(3);
VARS: R(0), SQUARER(0), AVGSQRR(0);

R = NEWCOEFFR(LENGTH);
SQUARER = SQUARE(R);
AVGSQRR = AVERAGE(SQUARER, SMOOTH);

PLOT1(AVGSQRR, "AVGSQRR");
PLOT2(1, "UPPER");
PLOT3(0, "LOWER");

{COPYRIGHT C 1997, TECHNICAL ANALYSIS, INC.}```