Skip to content

Stoch (Stochastic Oscillator)

What it shows: where the close sits within the high-low range of the last few candles, from 0 (at the lowest low) to 100 (at the highest high). %K is the main line, %D a smoothed copy.

How people use it: below 20 is "oversold" (price near the bottom of its recent range), above 80 "overbought". Range traders buy when it turns back up from low levels. %K crossing %D is a faster timing signal.

Pairs well with: ADX or Choppiness (stochastic signals work best when the market is moving sideways) and a moving average for the trend.

Settings

Setting Default What it does
%K 14 How many candles define the high-low range. Shorter swings more and reaches the extremes more often.
%D 3 Smoothing of the %D line. Larger makes %D slower, so %K / %D crosses come less often.
Slowing 3 Extra smoothing of %K. Larger gives a calmer line and fewer signals.
Oversold 20 The "low" line for the ready-made conditions. Lower gives fewer, deeper dips.
Overbought 80 The "high" line. Higher gives fewer, stronger moves.

You set the defaults on the Indicators page. A condition can use its own settings, which override the defaults for that condition only.

Ready-made conditions

For Condition Fires when
Buy Stoch %K below 20 every candle Stoch %K is below 20
Buy Stoch %K crosses above 20 the one candle Stoch %K moves from below 20 to above it
Buy Stoch %K crosses above %D the one candle Stoch %K moves from below the %D line to above it
Sell Stoch %K above 80 every candle Stoch %K is above 80
Sell Stoch %K crosses below 80 the one candle Stoch %K moves from above 80 to below it
Sell Stoch %K crosses below %D the one candle Stoch %K moves from above the %D line to below it

"Above", "below", "is" and "rising" / "falling" stay true on every candle the state lasts, so they can fire many candles in a row. "Crosses" and "flips" fire once, on the candle it happens, so you get one signal per move. Numbers in the condition names follow your settings on the Indicators page.

Warnings you may see

  • "Stoch(14,3,3) %K only moves between 0 and 100, so 200 can never be reached." (also for Stoch(14,3,3) %D): a number you typed is outside the range this line can take, so the condition can never be true (or is always true). Check the number. You can still save it.
  • "It compares a line with itself (same indicator, same settings), so it can never fire. Give the two lines different settings.": both sides of the condition are the very same line. Pick a different line or different settings for one side. With ">=", "<=", "==" or "touches" the message ends "so it is always true" instead.
  • "It can never be true: a cross happens on one candle, so it cannot happen on N candles in a row. Use 'within the last N candles' instead.": a "crosses" condition with a "… in a row" lookback of 2 or more. Switch the lookback to Within the last.
  • "%K must be between 1 and 1000" / "%K must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.
  • "%D must be between 1 and 1000" / "%D must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.
  • "Slowing must be between 1 and 1000" / "Slowing must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.

Where they show: on the Strategies page, open Create entry conditions / Edit entry conditions (or the exit ones). Each condition's messages appear right under it. The setting messages ("must be between", "whole number", "must be one of", "must be smaller than") start with the indicator's short name, for example "MACD: Fast must be between 1 and 1000", and keep the conditions from being saved until fixed. The other warnings never block saving and are repeated in the strategy's Entry or Exit section, starting with the condition's name.

Good to know

  • It is worked out from each candle's high, low and close (not volume).
  • In a strong trend it can stay above 80 (or below 20) for a long time, so "overbought" alone is not a reason to sell.
  • It needs some history before its value settles: %K + %D + Slowing candles (20 at 14 / 3 / 3). Apathia loads that history for you.
  • The ready-made level conditions use %K, the main line.