What RSI and Stochastic measure
The 14-period Wilder RSI starts with average gains and average losses over the first 14 close-to-close changes. On each subsequent bar it updates each average with (13 × previous average + current gain or loss) ÷ 14. RSI is 100 × average gain ÷ (average gain + average loss). The older smoothed values carry forward.
Raw 14-bar Stochastic %K is 100 × (close − lowest low) ÷ (highest high − lowest low). Include the current bar in the 14-bar window. A Stochastic set to 14, 3, 3 averages three raw readings for the plotted %K, then averages three plotted %K readings for %D.
The usual reference bands are 30 and 70 for RSI, and 20 and 80 for Stochastic. A Stochastic reading of 80 describes a position in the recent price range. An RSI reading of 70 describes the balance of smoothed gains and losses. Stochastic RSI is a third calculation that measures RSI within a window of its own readings.
