Class RelativeStrengthIndex
- Namespace
- FinanceSharp.Indicators
- Assembly
- FinanceSharp.dll
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
public class RelativeStrengthIndex : Indicator, IIndicator, IUpdatable
- Inheritance
-
RelativeStrengthIndex
- Implements
- Inherited Members
- Extension Methods
Constructors
RelativeStrengthIndex(int, MovingAverageType)
Initializes a new instance of the RelativeStrengthIndex class with the specified name and period
public RelativeStrengthIndex(int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)
Parameters
periodintThe period used for up and down days
movingAverageTypeMovingAverageTypeThe type of moving average to be used for computing the average gain/loss values
RelativeStrengthIndex(string, int, MovingAverageType)
Initializes a new instance of the RelativeStrengthIndex class with the specified name and period
public RelativeStrengthIndex(string name, int period, MovingAverageType movingAverageType = MovingAverageType.Wilders)
Parameters
namestringThe name of this indicator
periodintThe period used for up and down days
movingAverageTypeMovingAverageTypeThe type of moving average to be used for computing the average gain/loss values
Properties
AverageGain
Gets the indicator for average gain
public IndicatorBase AverageGain { get; }
Property Value
AverageLoss
Gets the EMA for the down days
public IndicatorBase AverageLoss { get; }
Property Value
IsReady
Gets a flag indicating when this indicator is ready and fully initialized
public override bool IsReady { get; }
Property Value
MovingAverageType
Gets the type of indicator used to compute AverageGain and AverageLoss
public MovingAverageType MovingAverageType { get; }
Property Value
WarmUpPeriod
Required period, in data points, for the indicator to be ready and fully initialized.
public override int WarmUpPeriod { get; }
Property Value
Methods
Forward(long, DoubleArray)
Computes the next value of this indicator from the given state
protected override DoubleArray Forward(long time, DoubleArray input)
Parameters
timelonginputDoubleArrayThe input given to the indicator
Returns
- DoubleArray
A new value for this indicator
Reset()
Resets this indicator to its initial state
public override void Reset()