RSI

The strength of recent gains against recent losses, from 0 to 100.

Relative Strength Index (Wilder): average gain and average loss of the source's changes, Wilder-smoothed and seeded with their simple average over the first length changes; RSI = 100 × gain ÷ (gain + loss). Ready at length + 1 candles; not ready while gain + loss is 0 (a flat series). Mirror: midpoint 50 (a mirrored price swaps gains and losses).

Settings

SettingDefaultRangeWhat it does
length141 to 500Wilder smoothing length (changes).

What it gives

OutputWhat it is
rsiRSI, 0–100.

What it reads

It reads open, high, low, close, hl2, hlc3, ohlc4, hlcc4, close by default.

Warm-up

With its default settings, RSI needs 141 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.

Related indicators

Used to build: Stochastic RSI

Test it

Copy this sentence into the Algonney chat to backtest it:

Backtest a strategy on BTC that uses RSI with its default settings