How to Calculate Stochastic Indicator?

In this Excel tutorial, you will learn how to calculate stochastic oscillator in Excel.

Stochastic oscillator formula

Here is the Stochastic Indicator Formula:

%K=(C–H) / (H–L)×100


  • C is the current closing price
  • H is the highest high over the lookback period
  • L is the lowest low over the lookback period

%K is plotted with another quantity, %D. %D is a simple moving average of %K over a defined smoothing period

Stochastic oscillator calculation

Use this formula to calculate the Stochastic Oscillator.

If your

  • Date is under column A>
  • Open is under column B
  • High is under column C
  • Low is under column D
  • Close is under column E
  • Then in column F

write this formula:

  • =100*(E1-D1) / (C1-D1)

Suppose this is what your data looks like:

Stochastic Indicator data table

Stochastic Indicator functions

After applying these formulas, two lines oscillating on a vertical scale from 0 to 100 are created. The extreme values are determined by the levels of 80 and 20. They can be drawn on a graph in Excel, as I did below.

Stochastic chart

This will be your final result.

The sell signal occurs when the faster %K line crosses the slower %D line above the 80 level. The buy signal occurs when the %K line crosses the %D line from the bottom, i.e., below the 20 level.

stochatic chart

You can read these signals directly from the chart.

This is how to Calculate the Stochastic Oscillator in Excel.