Skip to content

Where RSI sits within its own recent range, from 0 to 1.

StochRSI takes the last periods values of RSI and gives the latest one’s position between their lowest and highest. It moves faster than RSI and reaches its extremes far more often.

Traders read above 0.8 as overbought and below 0.2 as oversold. Because it is so quick, it is usually combined with a trend filter rather than traded alone.

StochRSI = (RSI − lowest RSI of the window) / (highest RSI of the window − lowest RSI of the window)

RSI uses the same periods.

Call: stochRsi(periods)

Setting Chart default
periods: Periods 14

What you get: a number.

Warm-up: with stochRsi(14), it asks for 0 bars of history and a run-up of 43, and its first value came on bar 28 of the example data.

StochRSI drawn by its own code on example prices

The prices are made up, hourly, and the same on every page, so the chart shows how the indicator behaves, not how a market behaved.

function onIntervalClose() {
if (OPEN_POSITIONS_COUNT === 0 && CLOSE > sma(50) && stochRsi(14) < 0.2) {
openPosition("BUY", { quantity: 10000, stopLossPips: 25, takeProfitPips: 40 });
}
}

If RSI has not moved at all across the window, the range is zero and the value is not a number.