QuantStudio Financial Data Analysis and Trading Framework

LRI Class

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

[Visual Basic]
Public Class LRI
    Inherits TIndicator
[C#]
public class LRI : TIndicator

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

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:

Example

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);

Requirements

Namespace: RQuant.Indicator

Assembly: RQuant.Indicator (in RQuant.Indicator.dll)

See Also

LRI Members | RQuant.Indicator Namespace