Lean  $LEAN_TAG$
QuantConnect.Indicators.RelativeStrengthIndex Class Reference

Represents the Relative Strength Index (RSI) developed by K. Welles Wilder. You can optionally specified a different moving average type to be used in the computation More...

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

Public Member Functions

 RelativeStrengthIndex (int period, MovingAverageType movingAverageType=MovingAverageType.Wilders)
 Initializes a new instance of the RelativeStrengthIndex class with the specified name and period More...
 
 RelativeStrengthIndex (string name, int period, MovingAverageType movingAverageType=MovingAverageType.Wilders)
 Initializes a new instance of the RelativeStrengthIndex class with the specified name and period More...
 
override void Reset ()
 Resets this indicator to its initial state More...
 

Public Attributes

override bool IsReady => AverageGain.IsReady && AverageLoss.IsReady
 Gets a flag indicating when this indicator is ready and fully initialized More...
 

Protected Member Functions

override decimal ComputeNextValue (IndicatorDataPoint input)
 Computes the next value of this indicator from the given state More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.Indicator
 Indicator (string name)
 Initializes a new instance of the Indicator class using the specified name. More...
 

Properties

MovingAverageType MovingAverageType [get]
 Gets the type of indicator used to compute AverageGain and AverageLoss More...
 
IndicatorBase< IndicatorDataPointAverageLoss [get]
 Gets the EMA for the down days More...
 
IndicatorBase< IndicatorDataPointAverageGain [get]
 Gets the indicator for average gain More...
 
int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 
- Properties inherited from QuantConnect.Indicators.Indicator
static int DefaultWindowSize = 2 [get]
 The default size of the history window for the indicator 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

Represents the Relative Strength Index (RSI) developed by K. Welles Wilder. You can optionally specified a different moving average type to be used in the computation

Definition at line 24 of file RelativeStrengthIndex.cs.

Constructor & Destructor Documentation

◆ RelativeStrengthIndex() [1/2]

QuantConnect.Indicators.RelativeStrengthIndex.RelativeStrengthIndex ( int  period,
MovingAverageType  movingAverageType = MovingAverageType.Wilders 
)

Initializes a new instance of the RelativeStrengthIndex class with the specified name and period

Parameters
periodThe period used for up and down days
movingAverageTypeThe type of moving average to be used for computing the average gain/loss values

Definition at line 48 of file RelativeStrengthIndex.cs.

◆ RelativeStrengthIndex() [2/2]

QuantConnect.Indicators.RelativeStrengthIndex.RelativeStrengthIndex ( string  name,
int  period,
MovingAverageType  movingAverageType = MovingAverageType.Wilders 
)

Initializes a new instance of the RelativeStrengthIndex class with the specified name and period

Parameters
nameThe name of this indicator
periodThe period used for up and down days
movingAverageTypeThe type of moving average to be used for computing the average gain/loss values

Definition at line 59 of file RelativeStrengthIndex.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.RelativeStrengthIndex.ComputeNextValue ( IndicatorDataPoint  input)
protected

Computes the next value of this indicator from the given state

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

Definition at line 83 of file RelativeStrengthIndex.cs.

◆ Reset()

override void QuantConnect.Indicators.RelativeStrengthIndex.Reset ( )

Resets this indicator to its initial state

Definition at line 118 of file RelativeStrengthIndex.cs.

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.RelativeStrengthIndex.IsReady => AverageGain.IsReady && AverageLoss.IsReady

Gets a flag indicating when this indicator is ready and fully initialized

Definition at line 71 of file RelativeStrengthIndex.cs.

Property Documentation

◆ MovingAverageType

MovingAverageType QuantConnect.Indicators.RelativeStrengthIndex.MovingAverageType
get

Gets the type of indicator used to compute AverageGain and AverageLoss

Definition at line 31 of file RelativeStrengthIndex.cs.

◆ AverageLoss

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.RelativeStrengthIndex.AverageLoss
get

Gets the EMA for the down days

Definition at line 36 of file RelativeStrengthIndex.cs.

◆ AverageGain

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.RelativeStrengthIndex.AverageGain
get

Gets the indicator for average gain

Definition at line 41 of file RelativeStrengthIndex.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.RelativeStrengthIndex.WarmUpPeriod
get

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

Definition at line 76 of file RelativeStrengthIndex.cs.


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