How to Calculate Stock Stochastics and Make a Stochastic Oscillator

by Eric Bank ; Updated July 27, 2017
A stochastic oscillator is supposed to predict prices.

A stock stochastic is a calculated number based on recent price movements of a stock. It is used by technical analysts, who believe that they can reliably predict stock prices by examining historical price and volume patterns. A stochastic oscillator is a buy/sell indicator that compares a stock stochastic against its three-day moving average. Technical analysis is controversial and many detractors claim it is useless or worse.

Inputs to the Calculation

To compute a stochastic, you must first decide on the length and number of periods to use. A common choice is the most recent 14 periods of one day each. You must determine three prices for the time frame: the highest high, the lowest low and the current close. Highs and lows are the intra-day top and bottom prices in any one period, so that the highest high is the top intra-day price in the 14-day time frame and the lowest low is the bottom price.

The Stock Stochastic Formula

The stock stochastic, %K, is a fraction multiplied by 100. The numerator is the current closing price minus the lowest low. The denominator is the highest high minus the lowest low. The stochastic indicates where the current closing price sits relative to the price range for the time frame. For example, if the highest high for a stock over 14 days was 110 and the lowest low was 100, the denominator equals 10. If the current closing price is 108, the stochastic is 80 -- that is, 100 times the result of 8 divided by 10.

Plotting the Oscillator

The stochastic is called an oscillator because it bounces between values of zero and 100. To use it as a technical indicator, you must first take its three-period simple moving average. You do this my summing the last three readings of %K and dividing by 3, giving the moving average called %D. You plot the values of %K and %D on a chart with time as the x-axis and price as the y-axis. The lines formed by connecting the daily readings of %K and %D will periodically cross one another, which sometimes creates a signal to buy or sell the stock.

Interpreting the Oscillator

The originator of the stochastic oscillator, George Lane, interpreted buy and sell signals as stemming from divergent patterns between %K and %D at a crossover point. For example, a "buy" signal occurs if %K suddenly moves from below to above %D while %D is still moving lower. A sell signal would be the opposite. Over time, others have extended the oscillator by using different moving averages and by interpreting %K to indicate and "oversold" or "overbought" stock, meaning stocks that might be about to reverse their trends.

About the Author

Based in Chicago, Eric Bank has been writing business-related articles since 1985, and science articles since 2010. His articles have appeared in "PC Magazine" and on numerous websites. He holds a B.S. in biology and an M.B.A. from New York University. He also holds an M.S. in finance from DePaul University.

Photo Credits

  • innovatedcaptures/iStock/Getty Images