Stochastic RSI
Where the RSI sits in its own recent range, from 0 to 100.
Stochastic of the RSI: raw = 100 × (RSI − lowest RSI) ÷ (highest RSI − lowest RSI) over the last stoch_length RSI values; %K = SMA(raw, k_smooth); %D = SMA(%K, d_length). A flat RSI window is not ready, never 50. Mirror: midpoint 50 (RSI mirrors around 50, so its stochastic does too).
Settings
| Setting | Default | Range | What it does |
|---|---|---|---|
| rsi_length | 14 | 1 to 500 | Wilder length of the RSI. |
| stoch_length | 14 | 1 to 500 | RSI values in the stochastic window. |
| k_smooth | 3 | 1 to 100 | SMA length of %K. |
| d_length | 3 | 1 to 100 | SMA length of %D. |
What it gives
| Output | What it is |
|---|---|
| %K | %K, 0–100. |
| %D | %D, 0–100. |
What it reads
It reads open, high, low, close, hl2, hlc3, ohlc4, hlcc4, close by default.
Warm-up
With its default settings, Stochastic RSI needs 161 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.
Related indicators
Built from: RSI, Stochastic
Test it
Copy this sentence into the Algonney chat to backtest it:
Backtest a strategy on BTC that uses Stochastic RSI with its default settings