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

SettingDefaultRangeWhat it does
rsi_length141 to 500Wilder length of the RSI.
stoch_length141 to 500RSI values in the stochastic window.
k_smooth31 to 100SMA length of %K.
d_length31 to 100SMA length of %D.

What it gives

OutputWhat 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