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
| Setting | Default | Range | What it does |
|---|---|---|---|
| length | 14 | 1 to 500 | Wilder smoothing length (changes). |
What it gives
| Output | What it is |
|---|---|
| rsi | RSI, 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