Stochastic Oscillator Explained: Settings, Signals and Strategy

Intermediate8 min read
Laptop screen showing a trading chart in a dark room

What Is the Stochastic Oscillator?

The stochastic oscillator is a momentum indicator that shows where the latest close sits inside the recent high-low range, on a scale from 0 to 100. Near 100 means price closed near the top of that range; near 0 means near the bottom. Traders use it to time entries and spot fading momentum.

It was developed by George Lane in the 1950s. His idea was simple: in an uptrend, prices tend to close near the top of their recent range, and in a downtrend near the bottom. When closes slip away from that edge, momentum (the speed of the move) is fading, and momentum often changes before price does.

How Is the Stochastic Oscillator Calculated?

The indicator draws two lines in a panel below your chart:

  • %K = (close − lowest low) ÷ (highest high − lowest low) × 100. The lowest low and highest high are taken over the last N periods, usually 14. A period is one candle.
  • %D = a simple moving average of %K, usually over 3 periods. It is the slower “signal” line.

Suppose that over the last 14 candles EUR/USD made a highest high of 1.1050 and a lowest low of 1.0950, and the latest candle closed at 1.1030.

  • Close − lowest low = 1.1030 − 1.0950 = 0.0080, or 80 pips (a pip is the smallest standard price step, 0.0001 here).
  • Highest high − lowest low = 0.0100, or 100 pips.
  • %K = 0.0080 ÷ 0.0100 × 100 = 80.

Price closed 80% of the way up its 14-candle range. If the two %K readings before that were 70 and 60, then %D = (80 + 70 + 60) ÷ 3 = 70. The result is always a percentage, so it never leaves the 0 to 100 scale and you can compare readings across any pair or timeframe.

Fast, Slow and Full Stochastic: What Is the Difference?

The raw %K line is jumpy, so most platforms smooth it. Three versions exist:

  • Fast stochastic: the raw %K from the formula above, plus %D as its 3-period average. Quick but noisy.
  • Slow stochastic: the fast %D becomes the new, smoother %K, and a 3-period average of that becomes the new %D. This is what most traders mean by “stochastic”.
  • Full stochastic: the same idea, but you choose all three numbers: the lookback, the smoothing of %K and the smoothing of %D.

That is why settings come as three numbers. A full stochastic at 14,3,3 is simply a slow stochastic. The order of the numbers differs between platforms, so read the labels in the settings box.

What Are the Best Stochastic Settings?

There is no best setting, only a trade-off between speed and noise. Two defaults are common:

  • 14,3,3: the classic setting in most textbooks and charting packages.
  • 5,3,3: the default in MetaTrader 4 and MetaTrader 5, shown as %K period 5, %D period 3, slowing 3. It looks back only five candles, so it reacts fast and reaches the extremes often.

A short lookback gives more signals and more false ones; a long one gives fewer, later signals. If the MetaTrader default feels too twitchy, change 5 to 14 before you judge the indicator, then keep it fixed while you test. Changing settings until last month’s chart looks perfect is called curve fitting, and it rarely survives new data.

What Do the 80 and 20 Levels Mean?

Readings above 80 are called overbought, and readings below 20 are called oversold. The names mislead. Above 80 only means that price is closing in the top fifth of its recent range, which is exactly what a healthy uptrend does. “Overbought” does not mean “sell”, and “oversold” does not mean “buy”.

In a strong trend the stochastic can stay above 80 or below 20 for a long time. A trader who sells every touch of 80 in an uptrend gets stopped out repeatedly. The zones are information, not orders.

How to Use the Stochastic Oscillator: Three Signals

  • The %K/%D cross: %K crossing above %D says short-term momentum is turning up; crossing below says it is turning down. Crosses in mid-scale are constant and mean little. Those below 20 or above 80 carry more weight.
  • Leaving the extreme zone: do not act when the lines enter a zone; wait for them to leave it. A move back above 20 says sellers have lost control of the range. A move back below 80 says buyers have.
  • Divergence: price makes a lower low but the stochastic makes a higher low (bullish), or price makes a higher high while the stochastic makes a lower high (bearish). It warns that the push is weakening, but it does not time the turn. More in divergence trading.
USD/JPY 4-hour candlestick chart above its 200-period moving average, with a slow stochastic 14, 3, 3 panel where %K crosses above %D below 20 and both lines then rise back above 20
A real USD/JPY 4-hour pullback in an uptrend (price above the 200-period average). The slow stochastic 14, 3, 3 dropped below 20, %K crossed above %D (yellow dot), and a candle later closed with both lines back above 20.

All three are stronger at a level that already matters, such as a marked zone of support or resistance.

How to Use Stochastic With the Trend

The most useful filter is the simplest: only take signals that agree with the bigger trend. In an uptrend, ignore overbought readings and wait for oversold ones. A dip below 20 inside an uptrend is a pullback (a short move against the trend), which is where trend traders want to buy. In a downtrend, do the reverse and sell only when the lines turn down from above 80.

The stochastic cannot define the trend, so use a separate tool. A common choice is a 200-period moving average: price above it, buys only; price below it, sells only. Another is to read the trend from a higher timeframe, as explained in multi-timeframe analysis.

Stochastic vs RSI: Which Is Better?

Both are momentum oscillators running from 0 to 100, but they ask different questions. The RSI indicator compares the size of recent up-closes with recent down-closes. The stochastic compares the latest close with the recent high-low range.

  • Speed: the stochastic moves faster and reaches its extremes more often. RSI is smoother and gives fewer signals.
  • Levels and lines: the stochastic uses 80 and 20 and has two lines, so it offers a cross signal. RSI uses 70 and 30 and has one line.
  • Best at: the stochastic suits ranges and pullback timing. RSI is often easier for judging the strength of a trend.

Neither is better. They are built from the same prices, so putting both on one chart gives you the same opinion twice. Pick one. Our guide to the best forex indicators explains how to choose one tool per job.

Weaknesses of the Stochastic Indicator

  • It stays pinned in trends. Counter-trend signals keep failing until the trend itself ends.
  • It whipsaws. A whipsaw is a signal that reverses almost at once. In choppy markets the lines cross back and forth, and each cross can cost a small loss.
  • One spike distorts it. A single news candle sets a new high or low, and that value stays in the calculation until it leaves the lookback window.

A Simple Stochastic Strategy to Test

A rule set to try on a demo account, not a promise:

  • Chart: 4-hour, slow stochastic 14,3,3, plus a 200-period moving average. Buys only while price is above the average; sells only below it.
  • Trigger (buy): both lines drop below 20, then %K crosses above %D and the candle closes with both lines back above 20. Reverse everything for sells.
  • Stop-loss: this order closes a losing trade. Place it below the lowest low of the pullback, or 1.5 × the ATR away if that is wider.
  • Target: twice the stop distance.
  • Risk: 1% of the account per trade. On a $1,000 account that is $10. With a 50-pip stop you can afford $10 ÷ 50 = $0.20 per pip, which is 0.02 lots on EUR/USD (a standard lot is 100,000 units). The position size calculator does this for any pair.

Record at least 100 trades, as described in backtesting and journalling. The indicator is free on every standard platform, so never pay for one. If you are still choosing where to trade, see our independent broker comparison.

On TradingView, the browser-based charting platform, you can read free stochastic scripts and test the rules above in the Strategy Tester through stochastic strategy scripts. Keep results on a demo account until they hold up.

The stochastic oscillator describes where price has closed within its recent range. It cannot tell you where price will go next, and it will give losing signals. Forex and CFDs carry a high risk of loss, and leverage, which lets a small deposit control a large position, makes losses arrive faster. Only risk money you can afford to lose.

FAQ

Is the stochastic oscillator a leading or lagging indicator?

It is usually classed as a leading indicator, because it can show momentum fading before price turns. But it is still calculated from past highs, lows and closes, so it cannot see ahead. It simply reacts faster than tools like moving averages. The price of that speed is more false signals, especially on short settings and in choppy markets.

What is the best timeframe for the stochastic oscillator?

It works the same way on every timeframe, because the formula only uses candles. Lower timeframes such as 5-minute charts give many more signals, but more of them are noise and the spread takes a bigger share of each trade. Many traders find the 1-hour, 4-hour and daily charts easier to trade, with the trend read from a higher timeframe.

Is the stochastic oscillator good for beginners?

Yes, as long as you learn its main trap first. It is simple to read and comes free on every platform. The common beginner mistake is selling every overbought reading and buying every oversold one, which fails badly in trends. Use it only in the direction of the bigger trend, practise on a demo account, and keep risk per trade small.

What is Stochastic RSI, and is it the same as the stochastic oscillator?

No. Stochastic RSI applies the stochastic formula to RSI values instead of to price, so it is an indicator of an indicator. It shows where the current RSI sits within its own recent range. It moves faster than either parent and hits its extremes more often, which means more signals and more false ones. Test it as a separate tool.

Free Stochastic Scripts for TradingView

Open-source Pine scripts from the ForexR library that build on this indicator. Copy one into TradingView's Pine Editor to try it on your own chart.

Free Oscillator and Momentum Pine Scripts · How to add a script to TradingView

Related on ForexR

Next lesson Divergence Trading: How to Spot Regular and Hidden Divergence Continue

More Intermediate Guides

Support and Resistance in Forex: How to Draw Key Levels How to Draw Trend Lines and Channels in Forex (Step by Step) Supply and Demand Zones in Forex: How to Find and Trade Them Forex Candlestick Patterns: Pin Bars, Engulfing, Doji & More Forex Chart Patterns: Reversal & Continuation Explained Forex Breakout Trading: How to Trade Breakouts & Spot Fakeouts Moving Averages in Forex: SMA vs EMA, Crossovers & Trends MACD Indicator Explained: Settings, Signals & Divergence RSI Indicator in Forex: Settings, Signals & Divergence Divergence Trading: How to Spot Regular and Hidden Divergence Bollinger Bands Explained: Squeeze, Band Walks & Signals Ichimoku Cloud Explained: A Simple Guide to All Five Lines Forex Pivot Points: Formula, Levels & How to Trade Fibonacci Retracement in Forex: Levels, Drawing & Examples ATR Indicator in Forex: How to Measure Volatility Most Volatile Currency Pairs (and the Calmest): How to Trade Them Best Forex Indicators for Beginners: The 7 Worth Learning Stop-Loss Strategies in Forex: Placement, Sizing & Trailing Take-Profit Strategies: When and Where to Exit a Winning Trade Risk-Reward Ratio Explained: What It Is and How to Use It Position Sizing in Forex: How to Calculate the Right Lot Size Forex Risk Management: Position Sizing & the 1-2% Rule How to Create a Forex Trading Plan (Simple Template Included) Forex Trading Styles: Scalping, Day, Swing & Position Forex Scalping for Beginners: How It Works, Costs and Rules Day Trading Forex: A Realistic Beginner’s Guide and Routine Swing Trading Forex: How to Catch Moves Over Days, Not Minutes Types of Forex Brokers: ECN vs STP vs Market Maker Explained How to Choose a Forex Rebate Provider: 9 Checks to Make First Total Trading Cost Explained: EUR/USD vs Gold After Rebates EA Settings Explained: Lot Size, Magic Number, Stop-Loss & More How to Backtest an EA in the MT4 and MT5 Strategy Tester How to Choose a Safe Forex EA: A 12-Point Checklist Pine Script Indicators vs Strategies vs Libraries Explained Pine Script Basics: Write Your First TradingView Indicator Pine Script Inputs: How to Make Script Settings Adjustable How to Read a Pine Script Before You Trust It: A Checklist How to Edit a Pine Script: Colours, Lengths and Filters Pine Script Alerts: alertcondition(), alert() and Webhooks Pine Script Sessions and Time: Shade London, New York, Asia Pine Script request.security(): Multi-Timeframe Done Safely Repainting in TradingView: How to Spot a Script That Repaints Build a Moving Average Crossover Strategy in Pine Script AI Trading Tools Explained: What Helps and What Sells AI Trading Signals: What They Are and When to Trust One How to Read a Signal Track Record: Win Rate, R and Sample Size AI Market Analysis: How Machines Read the Forex Market AI Sentiment Analysis in Trading: News Data Explained Fundamental Analysis in Forex: What Moves Currencies Safe-Haven Currencies: Risk-On and Risk-Off Explained Gold and the US Dollar: Why They Usually Move Apart Gold and Interest Rates: Why Real Yields Drive the Price Is Gold an Inflation Hedge? What 50 Years of Data Say Gold as a Safe Haven: When It Works and When It Fails Gold Trading Strategies: 5 Setups to Test on XAU/USD Gold Scalping: Costs, Timeframes and Rules for XAU/USD Gold Technical Analysis: Levels, ATR and Round Numbers How to Trade Gold During News: NFP, CPI and Fed Days Gold Correlations: Dollar, Yields, Silver, AUD and Bitcoin Gold-Silver Ratio Explained: How to Read and Trade It Gold vs Bitcoin: Which Is the Better Store of Value? How to Choose a Broker for Gold Trading: 9 Things to Check

Choose a Regulated Broker

Put what you’ve learned to work with a regulated broker. Compare costs, platforms and licences side by side.

Compare top brokers