rsi

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.rsi(source: ArrayLike,period: int = 14,method: str = 'wilder') -> np.ndarray

Relative strength index from average gains against average losses, 0 to 100.

Parameters

NameTypeDefault
sourceArrayLike
periodint14
methodstr'wilder'

Indicator: Relative strength index

wilder smooths gains and losses with Wilder's average, seeded with the mean of the first period changes (TA-Lib and MetaTrader 5). cutler uses simple averages. A window with no gain and no loss reads 50. The first value is on bar period.

Classpython
forge.ta.RSI(**inputs: Any) -> None

Momentum bounded 0 to 100, from average gains against average losses.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint141 to 5000
methodchoicewilder

gain = the change when it is positive, loss = minus the change when it is negative

wilder: the averages start as the mean of the first period gains and losses, then average = (previous average * (period - 1) + value) / period

cutler: the averages are simple means of the last period gains and losses

RSI = 100 * AvgGain / (AvgGain + AvgLoss)

A window with no gain and no loss reads 50.

Used in