Last Updated on 13 January, 2021 by Samuelsson
The stochastic oscillator is a momentum indicator that marks the location of the close relative to the range of the last n-bars. Traders often use stochastics to identify oversold and overbought levels that are likely to lead to a reversal of the trend.
In this guide to the stochastic indicator, you’ll learn everything you need to know about the indicator.
How Does Stochastic Work?
The Stochastic indicator was developed by George Lane in the late fifties and has become one of the most popular technical indicators among traders today. Being an oscillator, it outputs readings between 0 to 100, where readings above 80 are traditionally regarded as overbought, while readings below 20 indicate an oversold market.
The stochastic oscillator consists of two lines which are called %K and %D. Below you see the stochastic indicator applied to a chart.
The blue line is %K, which sometimes is referred to as the actual stochastic line, while %D is represented by the orange line.
Basically, %D (Blue) is a 3 period average of %K (Orange).
So, how is the %K line calculated? Let’s have a closer look at this!
How Stochastic Is Calculated
As we mentioned, %D (blue) is the three-period average of %K (Orange).
%K, in turn, is a measure of the close price in relation to the high-low range of the last n-bars, as defined by the user.
This means that the 14-period Stochastic puts the recent close in relation to the 14- bar high and 14-bar low. This also is the default setting for the indicator.
Here is the formula:
%K = (Last close – Lowest low for the period) / (highest high for the period – Lowest Low for the period) *100
With this formula, we get a ratio that tells us where the close is in relation to the range of the defined period.
For instance, if the market had a highest high reading of 100, and a lowest low of 50 for the period, then the range would be 100-50=50.
Now assume that the last bar closed at 60.
This means that the bar closed a 20% distance from the lowest low.
Let’s do the calculation with the formula we provided above!
Lowest low for the period = 50
Highest high for the period = 100
Recent close price = 60
%K = (60 – 50) / (100-50) *100
As you see, the formula for %K outputs 20, which means that the price occurred at a 20% distance from the lowest low of the range.
And then, just for the sake of clarity, we’ll once again note the %D is a three-period moving average of the %K reading.
Here you have the %K-line and %D-line with clear markings. Note how the D-line constantly lags the %K-line.
Difference Between Fast and Slow Stochastics
Now, you could say that there are two types of stochastic oscillators.
The first one we just covered is the fast stochastics.
The second type, is called slow stochastics.
In essence, the only difference is that the slow stochastic has another 3-period average applied to the %K-line, which makes the line appear smoother.
This also means that the Slow %K – line in effect has the same calculation as the Fast %D, since both are a 3-period average of %K.
To make it easier to understand, we have put both calculations side by side below.
Fast Stochastic Formula
Fast %K = basic formula of %K
Slow %D = 3-period average of Fast %K
Slow %K = 3-period average of Fast%K
Slow %D = 3- period average of Slow %K
So as you see, the Slowd% is actually smoothened not only one once, but actually twice!
In the image below you see the fast%K-line together with the slow%K-line. Note how slow %K doesn’t spike as much, due to the three-period smoothing.
Fast Stochastic VS Slow Stochastic
So, now you probably wonder which one you should go for in your trading. Well, there is no clear answer to this.
The slow stochastic has the benefit of not producing as many false signals like fast%-k since it’s smoothened by the average calculation. However, this comes at the cost of a less responsive indicator that will react slower to quick changes in price.
We recommend that you try out both, to see which one suits you best!
How to set the Slow Stochastic in Your Trading Platform.
Since the slow and fast stochastic indicators are close to identical, some trading platforms just come with one indicator where an additional input decides whether you’re using the slow or fast version.
In the image below I’ve opened the indicator settings for the stochastic indicator. I’m using the Tradingview platform, but most platforms should have similar settings.
Let’s go through the settings!
First, we have K. This is how far back you’re going to fetch the range that’s used to calculate the %K line.
The value you put into the second box determines the length of the average that will become the %D line.
Now, in the last box, you determine whether you want the slow or fast stochastic. Thus, this is the value that will determine the smoothing of the %K-line. In the image, it’s set to 1, which means that we’re using no smoothing and dealing with the fast stochastic indicator.
To instead get the slow stochastics, you would have to change this to 3, meaning that there is a three-period average applied to the %K-line.
How to Use Stochastics in Trading
Having covered the main uses of the Stochastics oscillator, we’ll now take a closer look at how traders typically use stochastic in their trading.
There is a wide variety of methods you could use, ranging from mean reversion oriented setups to those of a more trend-following nature. What will work for you depends largely on the market and timeframe you trade. For instance, mean reversion tends to work very well on stocks, but not as well on commodities, just to name one example.
Now, let’s explore some of the different methods you may use!
Oversold and Overbought Market Conditions
The perhaps most common approach is to use stochastics to identify overbought and oversold readings, in an attempt to successfully time market reversals.
Now, what’s important to understand here, is that stochastics will output its value unaffected by the volatility in the market. As we’ve covered, the only thing stochastic measures is the relationship of the close to the highest high and lowest low of the period.
According to some traders, this is a serious disadvantage, since a key ingredient in identifying oversold and overbought levels is the speed and momentum of the move leading to the overbought or oversold reading.
In our experience, this holds true in some cases, while it may be an advantage in other situations.
Leaving the above discussion, stochastic readings of 80 or more are considered overbought, while readings below 20 are considered oversold.
below we see how the market turned oversold as the stochastic indicator went below 20 and soon turned up again.
However, what is worth noting, and also always is the case with mean reversion strategies, is that a market may remain oversold or overbought for an extended period of time before actually reverting.
One rule of thumb is that the lower the stochastic reading, the higher the odds that the market will soon turn up , with the opposite condition applying for short trades.
Bullish and Bearish Divergences
Divergence is quite a common concept in technical analysis and is when the indicator goes in one direction, while the price goes in the opposite direction. In other words, they diverge.
Typically a divergence between a momentum oscillator like stochastics and the price tells us that a trend may be approaching its end. However, it doesn’t tell us the exact point at which the market is expected to turn around, which means that divergences preferably should be combined with other forms of technical analysis tools to become useful.
Here are the two types of stochastic divergences some traders like to use:
A bullish divergence is when the price performs two lower lows, while the second low appears higher in the stochastic indicator. This signals that the bearish trend is due for a change sometime soon.
A bearish divergence is when the price performs two higher highs, while the second high appears lower in the stochastic indicator. This signals that the bullish trend is due for a change sometime soon.
Another very common approach to trading the stochastics indicators is %K-line crossovers.
In essence, a %K-line crossover is when the %K-line crosses over the %D-line, which acts as a form of confirmation that the short term trend now has turned around.
Now, when looking for these kinds of crossovers, it’s better to use the slow stochastic, simply since it will produce much less false signals.
So, below you see an example of a bullish %K-line crossover.
As you might notice, stochastic came from low readings.
This is generally what we want to see, since it indicates that there is plenty of room for the market to move up without becoming too overbought.
Below you see one more example of a %K-line crossover, with the difference that this one is bearish.
Notice how we nearly got a bearish crossover twice, before there was a real signal that resulted in the following downturn.
Note that both charts above use the slow stochastic indicators, for the reasons already mentioned.
Tip: Adjust Your Stochastic Levels According to the Trend!
Until now we have regarded the overbought and oversold market thresholds to be static, and unaffected by the prevailing market trend.
However, this might not be the most effective approach, since a market in a downtrend will produce low stochastic readings with greater ease than a market in an uptrend.
When considering this, we may want to elevate the overbought/oversold thresholds for markets in a positive trend and lower them if the market is in a negative trend. Doing these changes would mean that:
- We get profitable oversold signals in an uptrend that we would have missed otherwise. This is because the advancing market will be quick to recover from oversold conditions, meaning that the stochastic indicator seldom gets deep into oversold territory.
- We’ll delay the entry for trades that enter on oversold signals. This way we don’t get in too early and may have a greater chance of picking the bottom with reasonable precision.
So, how should you adjust the settings?
Well, this depends on your personal preferences and the strength of the up or downtrend. However, here are some suggestions:
Thresholds for an Advancing Market
Thresholds for a Declining Market
One good way to know whether a market is bearish or bullish is by using the 200-period moving average. Many traders regard a market as bullish when it’s above the 200-period moving average, and bearish when it’s below.
The Best Settings for Stochastics
Coming from adaptive oversold and overbought thresholds, it’s time to discuss the best stochastic settings.
Now, when experimenting with the settings, we may change the value of %K and %D. And depending on their value, we’ll get quite different trading results. For instance, changing the length of %K from 14 to 5 will lead to a lot more crossings of overbought and oversold levels.
Now, we’ll not discuss specific levels in this article, since it’s impossible to tell which settings that work for your particular setup. The best settings will vary greatly depending on the market and timeframe that’s traded, as well as the trading strategy.
This is the reason why we recommend all traders to go to their market and experiment with different settings to see what works best. In particular, we recommend resorting to backtesting, with which you’ll get answers to your question in the quickest and easiest way possible
You may read more about backtesting in our complete guide to backtesting.
How to Improve the Signals – The Best Filters for Stochastics
Most times, we don’t recommend that you just go and trade signals without modifying them to work with your market and timeframe. You will have to add filters and extra conditions to ensure that you only enter trades when you have the odds on your side.
There are countless ways you can go about to improve the quality of the trades you take. In this section of the guide, we wanted to share some of the methods and techniques that have brought us the most success in the past.
Stochastic and ADX
Stochastic doesn’t react to the speed or momentum of a move since it’s only concerned with the relative position of the close to the recent high-low range.
This certainly can be a disadvantage in quite a lot of situations, where the speed and momentum could provide valuable information about the likelihood of a reversal, just to name one example.
Now, to compensate for the lack of such a measure, we may use the ADX indicator. ADX is one of our favorite indicators, and is used to measure the strength of a trend, and could compensate for the shortcomings of the stochastics indicator.
With ADX, readings above 25 are considered showing a strong trend, while readings below 15 indicate a calm market.
So how may we use this information with stochastics?
Well, in mean reversion, sudden and sharp moves often are more likely to give rise to quick trend reversals. Thus, if we could define whether a market became oversold rapidly with increasing momentum, that could be a way of ensuring that the market is more likely to turn around soon. And using ADX, that definition could be that we have an ADX reading of 30 or more.
You see an example of this setup below:
Our complete guide to ADX goes deeper into this and more, so be sure to check it out!
There are more oscillators out there than just the stochastic indicator.
For instance, you have the RSI indicator, which perhaps is even more popular than Stochastics.
Now, to get a more powerful oversold signal, you could try to combine the signal of the RSI with that of stochastic. In theory, this should lead to a better and more reliable signal.
For instance, if going long on oversold stochastic readings, you may demand that RSI shows oversold readings as well.
Below you see an example where both RSI and Stochastic readings are turning oversold.
Our complete guide to the RSI indicator delves deeper into the uses of the indicator, and much more!
Be sure to check in on the seasonal tendencies of your market. Often there are quite a lot of tendencies that lie hidden behind the surface, which could be used to determine if it’s favorable to enter a position or not.
For instance, some markets will have certain weekdays when they turn more bullish or bearish. And if you happen to spot a stochastic signal that corresponds with the tendency of that day, you may feel more secure in taking that trade.
To discover seasonal tendencies like these, you’ll have to use backtesting.
Stochastic Trading Strategies
Having had a look at three ways to improve a stochastics trading strategy, we now wanted to turn our attention to some trading strategies that rely on stochastics as the main method to find profitable entry setups.
Just remember that none of the strategies shown below should be regarded as ready-to-trade. As always, it’s paramount that you carry out your own tests to see what works well for your particular market and timeframe!
With this said, we genuinely believe that the two strategies we’re about to present will be great as inspirational sources!
Stochastic and Moving Average Profit Target
In this strategy, we’ll be going long on high stochastic readings when the market is below the 20-period moving average, while still being above the 200-period moving average.
This ensures that we’ve just had a short pullback in a long term positive trend, which makes it likely that the market soon is going to continue making new highs.
So, the rules for this strategy are:
- Stochastic goes above 80.
- The market is above its 50-period moving average, but above the 200-period moving average.
To exit the trade, we’ll wait until the market closes above the 50-period moving average. However, if it’s not hit within 10 bars, we’ll get out of the trade anyways.
Here is an example of a trade with this strategy. As you see,
Stochastic With Doji
Earlier in the article, you learned how you could use stochastic to know when the market is oversold. With this strategy, we’ll be looking to combine oversold readings with a popular candlestick pattern, called a “Doji”.
A Doji is when the market closes and opens around the same level, signaling uncertainty in the market. Together with oversold stochastic readings, a Doji would signal that the sellers are losing control, and may let buyers take over the lead going forward.
So, the rules for this strategy are that:
- We have a stochastic reading of 20 or less
- There is a Doji
Then we exit the market once stochastic turns over 50.
Below is an example of this setup:
If you want to learn more about candlestick patterns like the doji, our massive article on candlestick patterns is the perfect place to start!
Stochastic VS RSI
Stochastics and RSI are often used for similar purposes, and both are two great indicators that deserve their status as some of the most useful trading indicators.
As we’ve gone into a couple of times already, stochastics isn’t concerned with the velocity of the move, but only its position relative to the high-low range for the last period. This is the most significant difference to RSI, where the latter is built in a way so that it measures the speed and acceleration of a price move. This generally makes RSI the better choice for trending markets, where recent highs and lows may not be as relevant, due to the nature of a trending market that constantly is breaking free from previous local tops and bottoms.
- Stochastics is a trading indicator that consists of a %D line and a %K.
- It comes in two versions which are called fast and slow stochastic. The difference between the two is that the slow stochastic is smoothed with a three-period moving average
- The best settings depend on the market you trade, meaning that you’ll have to carry out backtesting yourself to find that what works best in your market.