What is stochastic?
The stochastic oscillator is a momentum indicator. It answers one question: where did the latest close land inside the recent high-to-low range?
- A close near the top of the range gives a high reading.
- A close near the bottom of the range gives a low reading.
The result sits on a fixed scale from zero to a hundred. It is drawn in a separate panel under the price chart.
The idea behind it is simple. In rising markets, closes tend to cluster near recent highs. In falling markets, they tend to cluster near recent lows. The stochastic indicator shows this position. It does not show the size of a move.
Like the RSI indicator and Williams %R, it belongs to the oscillator family. Williams %R is essentially the same calculation shown on an inverted scale.
Ready to try it on a real or demo account?
Partner link · trading carries a high risk of loss
The formula: %K and %D
%K is the main line:
%K = (Current close − Lowest low of the period) ÷ (Highest high of the period − Lowest low of the period), shown as a percentage.
%D is the signal line. It is a simple moving average of %K, so it is smoother and moves later than %K.
Fast, slow and full stochastic
| Version | %K line | %D line | Character |
|---|---|---|---|
| Fast | Raw %K from the formula | Average of raw %K | Very jumpy, many line crossings |
| Slow | Raw %K smoothed once ("slowing") | Average of the smoothed %K | Calmer; the common default |
| Full | Lookback, slowing and %D period all set by the user | Same | The flexible general form |
In MetaTrader, the "Slowing" field turns the fast version into the slow one. Set slowing to its minimum and you get the fast stochastic. Raise it and you get the slow one.
Default settings and how to add it in MT4/MT5
The steps are the same in both platforms. Open Insert → Indicators → Oscillators → Stochastic Oscillator, or drag it from the Navigator window onto a chart.
The settings window contains these fields:
- %K period: the lookback length for the high-low range.
- %D period: the length of the average that forms the signal line.
- Slowing: the extra smoothing applied to %K.
- MA method: the type of average (simple, exponential and so on).
- Price field: "Low/High" uses bar extremes. "Close/Close" uses closing prices only and gives a smoother range.
- Levels tab: the upper and lower reference lines. Traders often call the areas beyond them "overbought" and "oversold".
The default values appear in that window when you add the indicator. Use them as a starting point, not as a recommendation. Platform details are covered on the MetaTrader 4 and MetaTrader 5 pages.
How to read it: a drawn example
The sketch below is an illustration only. It shows no real prices.
- A: price lifts from a low. %K rises fast and %D follows. Closes are moving up within the range.
- B: price makes a new high. The oscillator reaches the upper area, but its peak at C is lower than its peak at B, while price at C is still high. This mismatch is called a bearish divergence. It shows weaker closes near the highs. It does not tell you when, or whether, price will turn.
- D: price drifts lower and the oscillator stays pressed near the lower area for several bars. This is how a steady decline looks on stochastic.
Typical uses
When people say "stochastic strategy", they usually mean one of these readings. None of them is reliable on its own.
- Range extremes. Readings in the upper or lower area show that closes sit near the edge of the recent range. See overbought and oversold for why "overbought" does not mean "about to fall".
- %K and %D crossings. These mark a change in short-term momentum. On the fast version they happen constantly.
- Divergence. Price and oscillator disagree at swing points.
- Trend filter. Some traders read stochastic only in the direction of the higher-timeframe trend. They use it to time pullbacks, not to call reversals. See multiple timeframe analysis.
Where the stochastic indicator misleads
- Strong trends. In a persistent trend, stochastic can stay in the upper or lower area for a long time. Reading every extreme as a turning point means repeatedly fighting the move.
- Tight ranges. When the high-low range is very narrow, small price changes swing the reading from one extreme to the other. The formula divides by a tiny number, so the indicator looks dramatic while price barely moves.
- Gaps and news spikes. A single large bar resets the range. The readings that follow are distorted until that bar leaves the lookback window.
- Short lookback on low timeframes. You get more crossings and more noise. Settings tuned to look good on past charts often fail on new data. This is curve-fitting.
- Lag from smoothing. Each smoothing step makes the lines cleaner but later. By the time a slow %D crosses, much of the move may be over.
- Unclosed bars. On the current bar the value keeps changing until the bar closes. A crossing seen mid-bar can disappear. See repainting indicators.
Parameter choices for experienced traders
- Lookback sets the definition of "range". A longer lookback ties readings to larger swings. A shorter one reacts to every small push.
- Slowing and %D trade noise for delay. Change one setting at a time and compare the results on the same chart.
- Close/Close vs Low/High: Close/Close ignores wicks. This can help on instruments that often spike.
- Levels: moving the reference lines further out produces fewer extreme readings, and each one is later.
- Combine with context. Support and resistance or a trend-strength gauge such as ADX can tell you whether the market is trending or ranging. Stochastic behaves very differently in those two states.
- Stochastic RSI applies the same formula to RSI values instead of price. It is faster and noisier still. See Stochastic RSI.
You can test settings on a demo account in MetaTrader before using them with real money. Leveraged CFD and forex trading can lose money fast, and no oscillator setting removes that risk. Read risk management before sizing any trade.
For more indicators and methods, see technical analysis.
Frequent questions
What does the stochastic oscillator measure?
It measures where the latest close sits within the high-low range of a chosen lookback period, on a scale from zero to a hundred.
What is the difference between %K and %D?
%K is the main calculated line. %D is a moving average of %K. It is smoother and moves later.
Fast or slow stochastic: which should I use?
Neither is right for every case. The fast version reacts quickly but gives many false crossings. The slow version is calmer but lags.
Is a high stochastic reading a sell signal?
No. It only means closes are near the top of the recent range. In a strong uptrend, readings can stay high for a long time.
Where are the default settings?
They appear in the indicator's settings window when you add it in MT4 or MT5. You can change them in the same window.
Can stochastic be used alone?
It can be plotted alone, but it has no view of trend, levels or news. Most traders read it together with price structure and treat it as one input among several.
