Skip to content
StatePath
Tool Atlasmarket.stoch_rsi

Tool

Stochastic RSI

market.stoch_rsi

MarketOscillator

Inputs

No typed inputs.

Outputs

Buffer (time series)

A 0–1 momentum line built on top of RSI; above 0.8 is overbought, below 0.2 oversold. It swings to the extremes more often than plain RSI.

Stochastic RSI (Stoch-RSI) is a momentum oscillator that applies the Stochastic formula to RSI values instead of to price. It reacts faster than plain RSI and reads on a 0–1 scale, where roughly above 0.8 is overbought and below 0.2 is oversold.

Stochastic RSI overview diagram

How it works

First RSI is computed over rsi_period bars. Then, over stoch_period bars, it measures where the current RSI sits between its own recent high and low: 1 means RSI is at the top of its range, 0 means the bottom. Because it stretches RSI across its range, it swings to the extremes more often than RSI itself.

Modes

Openopen

Build the underlying RSI from each bar's open price.

Open diagram

When to use: Use open when the bar's opening price best reflects the move you trade.

Highhigh

Build the underlying RSI from each bar's high price.

High diagram

When to use: Use high when the bar's high best reflects the move you trade.

Lowlow

Build the underlying RSI from each bar's low price.

Low diagram

When to use: Use low when the bar's low best reflects the move you trade.

Closeclose

Build the underlying RSI from each bar's close price (the usual choice).

Close diagram

When to use: Use close for the standard Stoch-RSI most traders expect.

Median (HL2)hl2

Build the underlying RSI from the bar's median price, the average of high and low.

Median (HL2) diagram

When to use: Use HL2 to smooth out where open and close fell and focus on the bar's range center.

Typical (HLC3)hlc3

Build the underlying RSI from the typical price, the average of high, low and close.

Typical (HLC3) diagram

When to use: Use HLC3 when you want the close to count but still blend in the bar's range.

Average (OHLC4)ohlc4

Build the underlying RSI from the average price, the mean of open, high, low and close.

Average (OHLC4) diagram

When to use: Use OHLC4 for the smoothest input, weighting the whole bar equally.

Configuration

rsi_periodscalar

How many bars the underlying RSI averages over before it is stretched. Larger = smoother and slower; smaller = faster and noisier. 14 is the classic default.

rsi_period diagram
stoch_periodscalar

How many bars of RSI history the Stochastic looks back over to find the recent high and low. Smaller makes the oscillator hit 0 and 1 more often.

stoch_period diagram
sourceenum

Which price each bar contributes to the underlying RSI (close is the usual choice).

Choices:openhighlowclosehl2hlc3ohlc4

Connects to

Feeds into

Examples

  • Filter: take a long only when Stoch-RSI turns up from below 0.2 inside an uptrend.
  • Cross Stoch-RSI with the 0.5 midline to read short-term momentum direction.

Common mistakes

  • Treating every push above 0.8 or below 0.2 as a reversal — in a strong trend it can pin at an extreme for many bars.
  • Forgetting it is twice-smoothed: with both periods short it becomes very whippy and gives frequent false signals.

See also