How it is calculated
First the catalogue's RSI over the RSI length, with Wilder's smoothing. The raw %K is 100 times the RSI minus its lowest value, divided by its highest minus its lowest, over the stochastic length; %K is an SMA of that over the %K smoothing, %D an SMA of %K. A range under 1e-9 RSI points counts as flat and gives 0. %K is held back until %D has a value. With a %K smoothing of 1 it is TA-Lib STOCHRSI, after Chande and Kroll 1994.
Reference: TA-Lib STOCHRSI (Chande and Kroll 1994), %K smoothed by an SMA
How to read it
Above 80 the RSI is at the top of its recent range, below 20 at the bottom. As a stochastic of an oscillator it reaches the extremes often and stays there in a trend, so it is noisier than RSI; crossings of %K and %D and returns across 20 or 80 matter more than the level. It shows where the RSI stands, not how strong the move is.
In a strategy
Timing inside a trend: in an uptrend, buy a pullback when ctx.ind("stochrsi", rsi_length=14, length=14).k crosses back above 20, compared with its value a bar earlier.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
RSI lengthrsi_length | Whole number | 14 | min 2, max 5000 |
Stochastic lengthlength | Whole number | 14 | min 1, max 5000 |
%K smoothingsmooth_k | Whole number | 3 | min 1, max 5000 |
%D lengthsmooth_d | Whole number | 3 | min 1, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| %K | Line |
| %D | Line |
Moves between 0 and 100. Guide lines at 20, 80.
Used in
No strategy template reads it yet.