Name, Sometimes Called:
r-Squared
Brief Description:
The r-Squared TAI shows the strength of a trend: the
more closely prices move in a straight line over time, the stronger
the trend.
Definitions, Formulas:
One of the results that can be obtained from Linear
Regression is r-squared. The r-squared value shows the “goodness
of fit” of a straight line to the price values over a given period.
If the r-squared value was 1.0, the fit would be perfect: the straight
line would pass through every data point. If the r-squared value
over 20 days was 0.70, then 70 percent of the security’s movement
over that period can be explained by linear regression. The other
30 percent is unexplained random noise.
The r-Squared TAI and the Linear
Regression Slope work together. While the Linear Regression
Slope shows the general trend direction (positive or negative),
the r-Squared TAI shows the trend’s strength. Hence, high r-Squared
values coupled with a large Linear Regression Slope are greatly
to be desired.
One formula for r2 is
r-squared = 100 * SS(regression) / SS(total)
where
SS(regression) = the sum of the squared difference between each
fitted value of Y and the mean of Y. It describes the variation
within the fitted values of Y. The squares are taken to 'remove'
the sign (+ or -) from the residual values to make the calculation
easier.
and
SS(total) = the sum of the squared difference between each value
of Y and the mean of Y. It describes the variation within the
values of Y.
Another formula for R squared is

Another formula, which is mathematically equivalent to the previous
one, is

where SSregression is the difference
between SStotal and SSerror.
r-squared is expressed in terms of a confidence value. That is,
when r-squared is above its critical value and increasing, we can
say that we are 95 percent confident that the trend is a strong
one. This confidence value depends on the number of time periods
used in its calculation, as shown in the following table. We use
n=14, which corresponds to an r2 critical
value of 0.27 for a 95% confidence level.
| Periods (n) |
r-squared critical
value for
95% confidence level |
| 5 |
0.77
|
| 10 |
0.40
|
| 14 |
0.27 |
| 20 |
0.20 |
| 25 |
0.16 |
| 30 |
0.13 |
| 50 |
0.08 |
| 60 |
0.06
|
| 120 |
0.03 |
Positive Development Calculation:
The Linear Regression
Slope TAI and the R-squared TAI are used together to compute
a single positive development. Both of the following conditions
must hold:
(1) The Linear Regression Slope
must cross above zero.
and
(2) r squared (r2) must equal or exceed
0.27. (See the table and discussion above.)
Similarly, the Linear Regression Slope and the R-squared TAI are
used to determine when a development is no longer positive. If either
of the following conditions holds, then a development is no longer
positive:
(1) The linear regression slope crosses below zero
or
(2) r squared (r2) is less than 0.27.
To reduce the potential of false positives produced by the traditional
specifications, we require that the 3-day price slope also trend
upward before a development is considered to be a positive development.
If this TAI is still positive tomorrow, it will no longer be new,
but will be a cumulative positive development (CPD).
If this TAI was a new positive development (NPD)
yesterday, and is still positive today, then it becomes a cumulative
positive development (CPD).
History:
Linear regression is a standard statistical tool.
Its outputs are being used here to analyze market prices.
The chart below shows R-squared in use with the Linear Regression
Slope indicator. During the period shown there were several new
positive developments, but we’ve highlighted only two. First, locate
the green-A. It indicates a point where the linear regression slope
(LRS) crossed over the zero point. This is, by itself, positive.
If you trace down you will see that r-squared was still under 0.27.
Both indicators have to be positive before there is a new positive
development (NPD). The vertical green bar shows where r-squared
crossed over 0.27 and LRS was still positive.
A few days later r-squared dipped below 0.27 and came back up
over it. This is a whipsaw. Had you exited your position and gotten
back in when r-squared crossed back over 0.27 you’d still be in
positive territory but with an increase in your commission expenses.
The red vertical line indicates where these two TAI no longer
indicate a positive development (NLPD). Or does it? Find the red-B.
Just a little before the day that LRS crossed under zero you can
see that r-squared dropped below 0.27 again. Remember, for this
technical analysis indicator BOTH have to be positive. That vertical
red line should be a bit earlier.

|