Lean  $LEAN_TAG$
QuantConnect.Indicators.LeastSquaresMovingAverage Class Reference

The Least Squares Moving Average (LSMA) first calculates a least squares regression line over the preceding time periods, and then projects it forward to the current period. In essence, it calculates what the value would be if the regression line continued. Source: https://rtmath.net/assets/docs/finanalysis/html/b3fab79c-f4b2-40fb-8709-fdba43cdb363.htm More...

Inheritance diagram for QuantConnect.Indicators.LeastSquaresMovingAverage:
[legend]

Public Member Functions

 LeastSquaresMovingAverage (string name, int period)
 Initializes a new instance of the LeastSquaresMovingAverage class. More...
 
 LeastSquaresMovingAverage (int period)
 Initializes a new instance of the LeastSquaresMovingAverage class. More...
 
override void Reset ()
 Resets this indicator and all sub-indicators (Intercept, Slope) More...
 
- Public Member Functions inherited from QuantConnect.Indicators.WindowIndicator< IndicatorDataPoint >
override void Reset ()
 Resets this indicator to its initial state More...
 

Public Attributes

int WarmUpPeriod => Period
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 
- Public Attributes inherited from QuantConnect.Indicators.WindowIndicator< IndicatorDataPoint >
int Period
 Gets the period of this window indicator More...
 
override bool IsReady
 Gets a flag indicating when this indicator is ready and fully initialized More...
 
virtual int WarmUpPeriod
 Required period, in data points, to the indicator to be ready and fully initialized More...
 

Protected Member Functions

override decimal ComputeNextValue (IReadOnlyWindow< IndicatorDataPoint > window, IndicatorDataPoint input)
 Computes the next value of this indicator from the given state More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.WindowIndicator< IndicatorDataPoint >
 WindowIndicator (string name, int period)
 Initializes a new instance of the WindowIndicator class More...
 
override decimal ComputeNextValue (T input)
 Computes the next value of this indicator from the given state More...
 
abstract decimal ComputeNextValue (IReadOnlyWindow< T > window, T input)
 Computes the next value for this indicator from the given state. More...
 

Properties

IndicatorBase< IndicatorDataPointIntercept [get]
 The point where the regression line crosses the y-axis (price-axis) More...
 
IndicatorBase< IndicatorDataPointSlope [get]
 The regression line slope More...
 
- Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider
int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 

Detailed Description

The Least Squares Moving Average (LSMA) first calculates a least squares regression line over the preceding time periods, and then projects it forward to the current period. In essence, it calculates what the value would be if the regression line continued. Source: https://rtmath.net/assets/docs/finanalysis/html/b3fab79c-f4b2-40fb-8709-fdba43cdb363.htm

Definition at line 29 of file LeastSquaresMovingAverage.cs.

Constructor & Destructor Documentation

◆ LeastSquaresMovingAverage() [1/2]

QuantConnect.Indicators.LeastSquaresMovingAverage.LeastSquaresMovingAverage ( string  name,
int  period 
)

Initializes a new instance of the LeastSquaresMovingAverage class.

Parameters
nameThe name of this indicator
periodThe number of data points to hold in the window

Definition at line 56 of file LeastSquaresMovingAverage.cs.

◆ LeastSquaresMovingAverage() [2/2]

QuantConnect.Indicators.LeastSquaresMovingAverage.LeastSquaresMovingAverage ( int  period)

Initializes a new instance of the LeastSquaresMovingAverage class.

Parameters
periodThe number of data points to hold in the window.

Definition at line 68 of file LeastSquaresMovingAverage.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.LeastSquaresMovingAverage.ComputeNextValue ( IReadOnlyWindow< IndicatorDataPoint window,
IndicatorDataPoint  input 
)
protected

Computes the next value of this indicator from the given state

Parameters
window
inputThe input given to the indicator
Returns
A new value for this indicator

Definition at line 81 of file LeastSquaresMovingAverage.cs.

◆ Reset()

override void QuantConnect.Indicators.LeastSquaresMovingAverage.Reset ( )

Resets this indicator and all sub-indicators (Intercept, Slope)

Definition at line 103 of file LeastSquaresMovingAverage.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ WarmUpPeriod

int QuantConnect.Indicators.LeastSquaresMovingAverage.WarmUpPeriod => Period

Required period, in data points, for the indicator to be ready and fully initialized.

Definition at line 49 of file LeastSquaresMovingAverage.cs.

Property Documentation

◆ Intercept

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.LeastSquaresMovingAverage.Intercept
get

The point where the regression line crosses the y-axis (price-axis)

Definition at line 39 of file LeastSquaresMovingAverage.cs.

◆ Slope

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.LeastSquaresMovingAverage.Slope
get

The regression line slope

Definition at line 44 of file LeastSquaresMovingAverage.cs.


The documentation for this class was generated from the following file: