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?
#How do RSI and the Stochastic oscillator differ?
#| RSI | Stochastic oscillator | |
|---|---|---|
| What it measures | Up moves compared with down moves | Where the close sits in the recent high-low range |
| Prices it uses | Closes | Closes, highs and lows |
| Usual setting | 14 candles | 14 candles, with a 3-period %D line |
| Lines | One line | Two lines: %K, and %D, a 3-period SMA of %K |
| Usual levels | 30 and 70 | 20 and 80 |
| Nears 100 when | Up moves have been large compared with down moves | The 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
- SMA vs EMA: which moving average reacts faster?The SMA counts every candle in its window the same; the EMA counts recent ones more. See how they differ, when people use each, and how to test it.
- Stochastic strategy with a trend filter, explainedA Stochastic strategy enters when %K crosses above %D below 20 and exits near 80, with a trend filter against down-trends. See the rules and the tests.