Saturday, April 05, 2008

The Stochastic Oscillator

One of the most popular technical tools is the stochastic oscillator. The Stochastic Oscillator is a momentum indicator that shows the location of the current close relative to the high/low range over a set number of periods.

The theory behind this indicator is that in a bull market, prices tend to close near their high but during a bear market, prices tend to close near their low. What the stochastic indicator is doing is that it's showing us the momentum of the closes within a give time period.
Stochastics move within a scale of 0 to 100. Moves below 20 are considered oversold and moves above 80 are overbought. Here is the formula for a 14 bar stochastic:
C = the most recent closing price
L14 = the low of the 14 previous trading sessions
H14 = the highest price traded during the same 14-day period.

%D = 3-period moving average of %K

Below is a weekly chart of the reit index with the stochastic oscillator in the lower pane. You'll notice that some of the crossover signals were profitable while other signals would have lost money. So as you can see, just taking crossover signals is not going to make you money. What we need is some kind of filter to help give us a higher percentage of winning trades. One of the best ways to do this is to only take stochastic crossover signals in the direction of the trend.

On the chart below I placed a 25 and 50 bar moving average. If the 25 average (blue) is above the 50 average (red) the trend is up and we should only be looking to take stochastic crossover signals when they are oversold (below 20) and then turn back up. If the 25 average is below the 50 average that defines a bearish trend and we should only be looking to sell short when the stochastics are overbought (above 80) and turn back down.

As you can see adding a couple of moving averages as a filter helped us to find more profitable trades and avoid many losing trades. There are other filters you can use such as setting the stochastics to be in tune with the dominant cycle that is present in the market you are trading. For example if there is a 50 bar cycle you might want to use a stochastic setting of 25 which is 1/2 the value of the cycle.
Another filter might be to only take stochastic signals in the direction of the higher timeframe. For example: If you are trading the daily timeframe, you might only want to take buy signals if the weekly stochastic is rising or is above 50.
Another way to use stochastics is to look for divergences but I've found that not to work too well, at least that's my experience.

In my opinion the best way to use the stochastic oscillator is to take signals only in the direction of the trend as shown in the chart below, that seems to work the best for me.

You can scroll through some of my archived posts to see real-time examples of how I've used the stochastic oscillator in my trading. Here are a few links.

Example number one

Example Number Two

Example number three In this example I used %R but stochastics would have showed me the same thing.

Example number four

Example number five


MrTrend said...

Hi Kevin,

Do you know of any online stock screener that would allow to screen stocks based on stochastics?

krhulak said...

Hi Kevin,

I always enjoy your posts and this one wasn't an exception. I just have an idea and want to know your opinion. Looking at the chart of REITs you supplied, I noticed that even during a downturn the crossovers below 20 would produce at least short term bounces and some of them (like Aug.2007 and Jan.2008) would be very profitable ones. So, would it make sense to you to buy ANY crossover below 20 regardless of the Moving Averages and the general trend and just use a very tight stop loss?

Thanks again for your excellent posts.

Kevin said...

Hi mrtrend,

The only online screener I use is the one from I haven't actually used their scan for stochastics but I'm sure I could use it for that if I wanted to.

Hi Krhulak,
No it wouldn't make sense to trade just any crossover because many of the crossovers AGAINST the trend tend to be small or false moves. It's not worth trading, trust me on this.

krhulak said...

Thanks Kevin. Then let me ask another related question. Suppose we have a position the same direction as the trend, say we are short in your REITs example. Then we see that the stockastics are crossing up below 20. Should we use it as an exit idicator or should we wait till the trend we are trending is officially over (that is the Moving Averages cross up). I analysed your trades and sometimes you exit by the turn of the stochastics (like the Canadian $ trade) and sometimes you wait till the trend is oficially over (like in your trade with QQQQ). I noticed that it is really difficult for me to find a good point to exit a trade (regardless if I win or lose). What is your criteria? Could the stochastics help? Again, thanks for your help!

hkc_00 said...

Hi Kevin:

Thanks for the informative post. Right now, on INDU, SPX, QQQQ, they all have uptrend on the weekly and start of a downtrend crossover at overbought level, so should I trade out of the market? or would the downturn be false and short lived, and for long, it would be better to stay in? Thanks again for your response.

Kevin said...

Hi guys,

I wouldn't use the stochastics for an exit..I'd only use it for an entry point in the direction of the trend.

aviator said...

Awesome post - very useful. Question regarding this method - Do you enter as soon as the crossover occurs (on a weekly chart) irregardless of what day of the week it is or do you wait for the weekly close on friday?

Also, do you use any type of analysis on the daily chart to fine tune your entry after the signal on the weekly stoch is given?


Anonymous said...

What would you use to tine the ezit?

Anonymous said...

"time the exit", I meant :)

Kevin said...

Hi Aviator,

If I was using the weekly charts, I'd wait until the weekly bar closed which would be friday's close.

For my exits I usually use price targets which are based on the size of the price formation I am trading. I do not use stochastics to exit my trades.

Elaine said...

Hi Kevin,

Do you subscribe to and if so what package do you subscribe to? Would you recommend it to others?

Anonymous said...

That was useful!

Anonymous said...

I just stumbled onto this post...don't know how I missed it, considering I read almost every other post you publish.

I use Stochs in a similar way -- however instead of using two moving averages, I use average daily ranges as envelopes on a moving average. In a long trend, for example, I'll wait for an oversold signal to trigger. This signal has be occur in confluence with a price deviation based on a very simple ratio of a longer term and shorter term average daily range over x periods. You could say it's almost like using standard deviation regression lines...or median lines...but of course based on a statistical price range.

Combined with a volatility stop and an exit based, again, on statistical excursions, I find that I get shaken out of less trades and am able to trade more efficiently...but it's harder to trade than it looks on the know what I mean? This last week was awful.

Kevin said...

Yes Elaine, I do subscribe to and I would recommend it.


This site may include market analysis. All ideas, opinions, and/or forecasts, expressed or implied herein, are for informational purposes only and should not be construed as a recommendation to invest, trade, and/or speculate in the markets. Trading and investing involves high levels of risk. Any investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied herein, are committed at your own risk, financial or otherwise.
Technorati Profile Finance Blogs - Blog Top Sites