Lessons

The stochastic oscillator, tested on real prices

The stochastic oscillator shows where today's close sits between the highest high and lowest low of the last 14 days, on a scale from 0 to 100. Under 20 is called oversold and over 80 overbought. We tested 18,029 signals in the 35 free stocks on HitBull. Twenty days after the oscillator climbed back above 20, the price was higher 55% of the time. After any day at all, it was higher 56% of the time.

How the stochastic oscillator is worked out

Take the last 14 trading days. Find the highest high and the lowest low. If today's close is at the low, the reading is 0; at the high, 100; halfway between, 50. That raw number jumps around a lot, so the usual version, called the slow stochastic, smooths it twice. %K is the average of the raw reading over 3 days. %D is the average of %K over another 3 days, a slower line that trails it. Those are the 14, 3 and 3 in its settings, and HitBull's defaults.

RSI asks a similar question with a different formula: it compares the size of up days and down days using closes only. The stochastic uses each day's high and low as well, so it reacts faster and reaches its extremes more often.

Reading 20 and 80

On a chart the oscillator sits in its own panel under the price, with lines at 20 and 80. A reading under 20 means the stock has been closing near the bottom of its two-week range. Over 80, near the top. Most traders don't act on the reading itself but on the moment %K leaves the zone: climbing back above 20 is read as a buy, falling back below 80 as a sell. That is the signal we tested. Some also wait for %K to cross %D.

A buy signal that worked

GOOGL, January 6, 2023

90100110120Sep 22Nov 22Jan 23Mar 23May 232080Stochastic 14, 3, 3%K back above 20, January 6, 2023
%K%D, with lines at 20 and 80

Alphabet, Google's parent company, fell through most of 2022. On January 6, 2023 its %K climbed back above 20. GOOGL barely dipped after that: its lowest close in the next 60 days was +1% from the signal. By February 2, 2023 it was +23%, and sixty trading days after the signal +20%.

This is the textbook case: a stock pressed to the bottom of its range that turns, and the oscillator turns with it.

Replay GOOGL from Dec 2022

A buy signal in a crash

SPY, March 2, 2020

200250300Nov 19Jan 20Mar 20May 20Jul 202080Stochastic 14, 3, 3%K back above 20, March 2, 2020
%K%D, with lines at 20 and 80

SPY, the fund that tracks the S&P 500, fell fast at the end of February 2020. On March 2, 2020 a one-day bounce lifted %K back above 20. Five trading days later SPY was -11%. By March 23, 2020 it had fallen 28% from the signal.

Because the stochastic measures the close against a short range, one strong day in a falling market is enough to lift it out of oversold. It said nothing about how far the fall had to go. A year later SPY was +25%, so the same signal looks fine or terrible depending on when you sold.

Replay SPY from Feb 2020

A sell signal that was right for a week

MSFT, April 14, 2025

350400450500550Jan 25Mar 25May 25Jul 25Sep 252080Stochastic 14, 3, 3%K back below 80, April 14, 2025
%K%D, with lines at 20 and 80

Microsoft bounced sharply in April 2025, and its %K shot above 80 within days. %K dropped back below 80 on April 14, 2025, a sell signal. For a week it looked right: by April 21, 2025 MSFT was -7%. Then it rose. Twenty trading days after the signal it was +16%, and sixty days after, +30%. %K fell back below 80 another 3 times in those sixty days.

In a strong rise the close keeps landing near the top of the range, so the oscillator lives above 80 and every small dip looks like a sell signal. A trader who sold each one kept getting out of a stock that kept going up.

Replay MSFT from Mar 2025

What 18,029 signals say

Here is every time the %K of one of the 35 free stocks climbed back above 20 or fell back below 80, set against every trading day in the same stocks. “Higher” means the close was above the close on the day of the signal.

CountHigher 5 days laterHigher 20 days laterHigher 60 days laterHigher a year laterMedian change after 20 days
Climbs back above 208,07852%55%58%63%+1%
Falls back below 809,95154%56%59%66%+1%
Any trading day229,94753%56%59%64%+1%

On these stocks the buy signal did no better than a random day, and the sell signal was followed by a higher price a year later 66% of the time, a little more often than any day (64%). Stocks that keep reaching the top of their range tend to be stocks in a rise, and a rise often keeps going.

These are 35 well-known stocks and funds still trading today, most of which rose over the years, so any buy signal looks good and any sell signal looks bad on them. Prices are adjusted for splits and dividends. Past prices don't promise future ones, and this is a simulator, not investment advice.

What the stochastic is good for

The oscillator answers one narrow question well: is the price near the top or the bottom of its recent range? That helps when a stock is moving sideways between two levels, where the top and bottom of the range really are turning points. It is much less useful in a trend, where the price can stay at one end for weeks. Many traders check the trend first, with a moving average or support and resistance, and use the stochastic only when the chart is going sideways. MACD and Bollinger Bands are other ways to read the same moves.

Practise reading it

The replay buttons above open HitBull a month before each signal, with the stochastic under the chart. Play on Daily candles and decide what you would do when %K leaves the zone, before you press GO and see what came next. The 2020 replay shows how quickly an oversold bounce can fail.

Then try a stock you don't know. Practice trading on an unfamiliar chart is the honest test of whether you would have trusted the signal.

Questions

What does the stochastic oscillator measure?

Where the latest close sits between the highest high and the lowest low of the last 14 days, from 0 at the low to 100 at the high. The slow version smooths it into %K and a slower %D line.

Is a stochastic below 20 a buy signal?

Not on its own. On HitBull's 35 free stocks, 20 days after %K climbed back above 20, the price was higher 55% of the time, against 56% for any trading day.

What is the difference between the stochastic oscillator and RSI?

RSI compares the size of recent up and down closes; the stochastic compares the close with the recent high and low, so it moves faster. On HitBull's free stocks %K fell back below 80 9,951 times, and a year later the price was higher 66% of the time.