RSI vs Stochastic: how the two oscillators differ

By Oalgo · Last reviewed

RSI compares the size of recent up moves with recent down moves. The Stochastic oscillator shows where the latest close sits inside the high-low range of the last candles. Both move between 0 and 100 and both are called oscillators, but they measure different things.

What do the two look like on the same prices?

#
Chart: example prices with a 14-period RSI below them. Lines mark the levels 30 and 70.PriceRSI 147030
Example prices, made up for this page. The same prices are used in the next chart.
Chart: the same example prices with their high-to-low ranges, and the Stochastic oscillator below them: the %K line, the %D line, and lines at the levels 80 and 20.PriceHigh to low%K%D8020
Example prices, made up for this page. Settings 14 and 3.

How do RSI and the Stochastic oscillator differ?

#
RSIStochastic oscillator
What it measuresUp moves compared with down movesWhere the close sits in the recent high-low range
Prices it usesClosesCloses, highs and lows
Usual setting14 candles14 candles, with a 3-period %D line
LinesOne lineTwo lines: %K, and %D, a 3-period SMA of %K
Usual levels30 and 7020 and 80
Nears 100 whenUp moves have been large compared with down movesThe close nears the highest high of the window

That last row is the clearest difference. The Stochastic oscillator reads exactly 100 whenever a candle closes at the highest high of its window, even after a small move. RSI moves toward 100 only when up moves have been large compared with down moves.

When do people use each?

#
  • RSI: enter when it crosses back above 30, or exit when it crosses below 70, often with a trend filter.
  • Stochastic oscillator: enter when %K crosses back above 20, or when %K crosses above %D while both are low.
  • Both are read as levels, so rules on them often assume price moves back toward its recent average. In a strong trend both can stay at an extreme for a long time.

How do you test the choice in Oalgo?

#

In Oalgo you can tell Oalgo AI your RSI or Stochastic rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.

  • Write one entry and one exit rule for each, with the same Stop Loss, so the only change is the indicator.
  • Run a backtest of each on the same dates, on a rising period and on a falling one.
  • Check the number of trades and the fees for each version.
  • Move the levels a little. If the report changes a lot, the first result may be fitted to one period.

What can neither tell you?

#

Neither says that price must turn. Both are built only from past prices and show where price has been, not where it is going. A rule on either one can enter too early in a strong move, and a test on past prices cannot show how it will behave on new ones.

Read next