| 
 
  | 
| 
 Description  | 
 The RSquared function identifies trending and non-trending markets. The function produces a value between 0 and 1. Values below 0.3 indicate non-trending markets while values above 0.7 are said to be trending. 
 Peaks above 0.7 are important signals in this study. As a trend develops, the RSquared value rises out of non-trending levels. When the RSquared value falls above 0.7, the market has peaked.  | 
| 
 
  | 
 
  | 
| 
 Formula  | 
 RSquared(SERIES, Period=10, Smooth=1)=begin SquareR = 0 AvgSqrR = 0 start = 0 finish = Period total = 0 average = 0 
 if Period > 0 then begin while start < finish do begin total = total + vchart(RSquared_1(SERIES, Period, start)[(start - 1)]) start=start+1 end average = total / Period end retval = Scale(average,TEN_THOUSANDTHS) end  | 
| 
 
  | 
 
  | 
| 
 Parameters  | 
 SERIES The SERIES directive makes this formula available as a Formula Study. SERIES refers to the instrument in a chart. SERIES does not become a study parameter. 
 Period Number of bars used to evaluate. The default is 10. 
 Smooth Number used to smooth the RSquared value. The default is 1.  | 
| 
 
  | 
 
  | 
| 
 Return Value  | 
 The square of the Pearson product moment correlation coefficient, R.  | 
| 
 
  | 
 
  | 
| 
 Examples  | 
 
  | 
| 
 
  | 
 
  | 
| 
 Comments  | 
 NA  | 
©2008 Aspen Research Group, Ltd. All rights reserved. Terms of Use.