# Stochastic RSI crossing overbought and oversold

The Stochastic RSI is a momentum oscillator that identifies overbought and oversold market conditions. It combines the concepts of the Relative Strength Index (RSI) and the Stochastic oscillator, applying the stochastic formula to the RSI values. This creates a more sensitive indicator that can capture quicker price reversals.

The Stochastic RSI oscillates between 0 and 100 and comprises two lines: %K and %D.

**Logic of the algorithm:**

- For long signals, the algorithm scans for a cross-over of %K over %D occurring below the oversold level (typically 20).
- For short signals, the algorithm scans for a cross-under of %K below %D occurring above the overbought level (typically 80).

Smoothing parameters are applied to %K and %D, usually set to 3 periods to reduce noise and provide more precise signals.