Stochastic calculation finds the range between an asset’s high and low price during a given period of time. The current securities price is then expressed as a percentage of this range with 0% indicating the bottom of the range and 100% indicating the upper limits of the range over the time period covered.
The idea behind this indicator is that prices tend to close near the extremes of the recent range before turning points. The Stochastic oscillator is calculated:

     %K = 100 * (closing price - price low) / (price high - price low)

Price is the last closing price
    LOWN(Price) is the lowest price over the last N periods
    HIGHN(Price) is the highest price over the last N periods
    EMA3(%D) is a 3-period exponential moving average of %K.
    EMA3(%D − Slow) is a 3-period exponential moving average of %D.

A 3-line Stochastics will give you an anticipatory signal in %K, a signal in the turnaround of %D at or before a bottom, and a confirmation of the turnaround in %D-Slow. [3] Typical values for N are 5, 9, or 14 periods. Smoothing the indicator over 3 periods is standard.
Dr. George Lane, a financial analyst, is one of the first to publish on the use of stochastic oscillators to forecast prices. According to Lane, the Stochastics indicator is to be used with cycles, Elliot Wave Theory and Fibonacci for timing.
In low margin, calendar futures spreads, you might use Wilders parabolic as a trailing stop after a Stochastics entry. A Centerpiece of his teaching is the divergence and convergence of trendlines drawn on Stochastics, as diverging/converging to trendlines drawn on price cycles. Stochastics has the power to predict tops and bottoms.

The signal to act is when you have a divergence - convergence, in an extreme area, with a crossover on the right hand side, of a cycle bottom. [4] Plain crossovers can occur too often. To avoid repeated whipsaws, one should wait for crossovers occurring together with an extreme pullback, after a peak or trough in the %D line.
If price volatility is high, an exponential moving average of the Stoch %D indicator may be taken. This statistic smooths out rapid fluctuations in price.
Some analysts argue that %K or %D levels above 80 and below 20 can be interpreted as extreme areas. On the theory that the prices oscillate, many analysts including George Lane, recommend that buying and selling be timed to the return from these thresholds. In other words, one should buy or sell after a bit of a reversal.
Practically, this means that once the price exceeds one of these thresholds, the investor should wait for prices to return through those thresholds.
In an uptrend, prices tend to make higher highs and the settlement price usually tends to be in the upper end of that time periods trading range. When the momentum starts to slow, the settlement prices will start to fade from the upper boundaries of the range. [5] Stochastics predicts turning points by comparing the closing price of a security to its price range. Prices tend to close near the extremes of the
recent range just before turning points. Stochastics turns down at or before the final price high.
An alert or set-up is present when the %D line is in an extreme area and diverging from the price action. The actual signal takes place when the faster % K line crosses the % D line.

Divergence - convergence is an indication that the momentum in the market is waning and a reversal may be in the making. The chart below illustrates an example of where a divergence in Stochastics relative to price, forecasted a reversal in the price's direction.