Linear Regression indicator (LRI)
For a list of all members of this type, see LRI Members.
System.Object
RQuant.Indicator.TTimeArray
RQuant.Indicator.TDoubleArray
RQuant.Indicator.TIndicator
RQuant.Indicator.LRI
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
The interpretation of a Linear Regression indicator is similar to a moving average. However, the Linear Regression indicator has two advantages over moving averages. Unlike a moving average, a Linear Regression indicator does not exhibit as much "delay." Since the indicator is "fitting" a line to the data points rather than averaging them, the Linear Regression line is more responsive to price changes.
The indicator is actually a forecast of the next periods (tomorrow?s) price plotted today. The Forecast Oscillator plots the percentage difference between the forecast price and the actual price. Tushar Chande suggests that when prices are persistently above or below the forecast price, prices can be expected to snap back to more realistic levels. In other words the Linear Regression indicator shows where prices should be trading on a statistical basis. Any excessive deviation from the regression line should be short-lived.
Formula:
TDataManager.cd("Demo");
TDailyArray Daily1 = TDataManager.GetStock("YHOO").DailyArray;
DateTime Date1 = DateTime.Parse("1999/02/08");
DateTime Date2 = DateTime.Parse("2000/12/29");
TDailyArray Daily = Daily1.Clone(Date1, Date2);
TCanvas Canvas = new TCanvas("Canvas","LRI DEMO",600,400);
LRI LRI = new LRI(Daily, 14);
Canvas.cd(1);
Daily.Draw("c");
Canvas.cd(2);
LRI.Draw(Color.Red);
Namespace: RQuant.Indicator
Assembly: RQuant.Indicator (in RQuant.Indicator.dll)
LRI Members | RQuant.Indicator Namespace