Next: RAVI, Previous: QStick, Up: Indicators [Index]

The R-squared indicator by Tushar Chande and Stanley Kroll is a measure of how
closely the past N days resemble a straight line, ie. a trend. It
calculates what is called in statistics the *coefficient of determination*
of the prices versus a straight line. This coefficient is written *r^2*,
hence the name of the indicator.

For reference, the formulas are as follows, where X values are the closing prices and Y values are a straight line 1,2,…,N. Variance is the square of standard deviation (see Standard Deviation).

(Covariance X,Y)^2 r^2 = ----------------------- Variance X * Variance Y Covariance X,Y = Mean (X*Y) - (Mean X) * (Mean Y) Variance X = Mean(X^2) - (Mean X)^2

The R-squared indicator ranges from 0 meaning no apparent correlation to the straight line, up to 1 for perfect correlation. The slope of the closing prices line doesn’t matter, nor does the absolute price level, only how well they make a straight line.

Chande and Kroll suggested using a 14-day period, and that’s the default in Chart.

Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014, 2015, 2016, 2017 Kevin Ryde

Chart is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.