IIndicatorsAccessor.RelativeStrengthIndex
method · IIndicatorsAccessor · cAlgo.API.Internals
DesktopCLICloud
The Relative Strength Index indicator measures turns in price by measuring turns in momentum.
Definition
RelativeStrengthIndex RelativeStrengthIndex(DataSeries source, int periods)
api.Indicators.RelativeStrengthIndex(source: DataSeries, periods: int) -> RelativeStrengthIndex
Parameters
| Name | C# type | Python type | Description |
|---|---|---|---|
source | DataSeries | DataSeries | The source data used for calculation. |
periods | int | int | The value of the periods used for calculation. |
Returns RelativeStrengthIndex — Relative Strength indicator instance
Examples
var rsi = Indicators.RelativeStrengthIndex(Bars.ClosePrices, 14);
if (rsi.Result.LastValue > 70)
Print("RSI(14) is overbought: {0}", rsi.Result.LastValue);
rsi = api.Indicators.RelativeStrengthIndex(api.Bars.ClosePrices, 14)
if rsi.Result.LastValue > 70:
api.Print(f"RSI(14) is overbought: {rsi.Result.LastValue}")