# Stochastic RSI

`stoch_rsi`

The stochastic oscillator applied to RSI.

## Inputs

| Name | Type | Default | Range |
| --- | --- | --- | --- |
| source | source | close |  |
| rsi_period | int | 14 | 1 to 5000 |
| stoch_period | int | 14 | 1 to 5000 |
| k_smooth | int | 3 | 1 to 5000 |
| d_smooth | int | 3 | 1 to 5000 |

## Outputs

| Name | Kind |
| --- | --- |
| k | value |
| d | value |

Warm-up: rsi_period + stoch_period + k_smooth + d_smooth - 3 bars (31 at the defaults).

Repaints: No.

## Formula

RSI is Wilder's relative strength index over rsi_period

raw = 100 * (RSI - lowest RSI) / (highest RSI - lowest RSI) over stoch_period; RSI itself when its range is 0

%K = the simple average of raw over k_smooth, %D = the simple average of %K over d_smooth
