The linear regression R-squared is an indicator used to determine the strength of the dominant market trend. It is typically used with other indicators such as Linear Regression Slope. The Slope indicates the overall market trend (positive or negative) and the R-Squared indicates the strength.
More in general, the R-squared or Coefficient of Determination is a number that indicates how well data fits a statistical model. It ranges from 0 to 1: the higher the value, the better the fit.
R 2 = 1 - SS res / SS tot , where:
- y[i] = data value at the (i)th position
- f[i] = fitted, model value in the (i)th position
- mean = 1/n*Sum(y[i])
- SStot = Total Sum of Squares = Sum((y[i]-mean)2)
- SSreg = Sum of Squares of Regression = Sum((f[i]-mean)2)
- SSres = Sum of Squares of Residuals = Sum((y[i]-f[i])2)
Find out more about chart indicators in the TWS Users' Guide can be found in our Users' Guide.