Table of Contents

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

period int

The period used for up and down days

movingAverageType MovingAverageType

The 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

name string

The name of this indicator

period int

The period used for up and down days

movingAverageType MovingAverageType

The 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

IndicatorBase

AverageLoss

Gets the EMA for the down days

public IndicatorBase AverageLoss { get; }

Property Value

IndicatorBase

IsReady

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

public override bool IsReady { get; }

Property Value

bool

MovingAverageType

Gets the type of indicator used to compute AverageGain and AverageLoss

public MovingAverageType MovingAverageType { get; }

Property Value

MovingAverageType

WarmUpPeriod

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

public override int WarmUpPeriod { get; }

Property Value

int

Methods

Forward(long, DoubleArray)

Computes the next value of this indicator from the given state

protected override DoubleArray Forward(long time, DoubleArray input)

Parameters

time long
input DoubleArray

The 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()