Indicators/probuilder · probacktest · proorder · proscreener

SmoothedStochastic

SmoothedStochastic in ProBuilder returns the slow stochastic oscillator, a noise-reduced 0 to 100 momentum measure. Syntax, formula, examples, thresholds.

Syntax

probuilder
SmoothedStochastic[N,K](price)

Parameters

NameTypeDefaultDescription
Ninteger14Lookback period over which the highest high and lowest low are taken.
Kinteger3Smoothing factor applied to produce the slow line. Higher values give a steadier but slower signal.
priceprice sourcecloseThe price series positioned within the range. Usually close.

Formula

code
%D = 100 * (H / B)
where H = sum over the window of (C - PB(n))
      B = sum over the window of (PH(n) - PB(n))
  • C is the closing price of each bar.
  • PB(n) is the lowest price of the past n periods.
  • PH(n) is the highest price of the past n periods.

Summing numerator and denominator separately before dividing is what smooths the line: a single extreme bar changes both sums only marginally, whereas the fast stochastic recomputes its ratio from scratch each bar.

How it works

The fast stochastic answers a simple question on every bar: as a percentage, where did price close inside its recent high-low range. That raw ratio is jumpy. SmoothedStochastic, also called the slow stochastic, accumulates the close-minus-low distances and the range widths over the window before dividing, then applies the K smoothing factor. The output still lives between 0 and 100, but individual outlier bars carry far less weight.

Readings near 100 mean price has been closing near the top of its range for several bars in a row, not just once. Readings near 0 mean the opposite. This persistence requirement is why the slow stochastic generates fewer, later, and generally cleaner signals than the fast version.

The indicator is commonly paired with a signal line (a short moving average of itself) and read through crossings, threshold exits, and divergences against price.

Examples

Example 1, New-high check on the oscillator (Indicator)

probuilder
mySMI = SmoothedStochastic[14,3](close)
// Flag bars where the oscillator is below its own 14-bar peak
IF (highest[14](mySMI) > mySMI) THEN
  signal = 1
ELSE
  signal = 0
ENDIF
RETURN signal

Computes the 14-period slow stochastic with a smoothing factor of 3, then flags bars where the oscillator sits below its own 14-bar high, marking fading upside momentum.

Example 2, Oversold bounce with signal-line logic (ProBacktest)

probuilder
// Buy when the slow stochastic leaves the oversold zone
slowSto = SmoothedStochastic[14,3](close)

IF NOT OnMarket THEN
  IF slowSto CROSSES OVER 20 THEN
    BUY 1 CONTRACT AT MARKET
  ENDIF
ELSIF slowSto CROSSES UNDER 80 THEN
  SELL AT MARKET
ENDIF

SET STOP %LOSS 2

Enters long when the oscillator recrosses 20 from below and exits when it drops back through 80, with a 2 percent protective stop.

Example 3, Dual-timeframe oversold scan (ProScreener)

probuilder
TIMEFRAME(1 day)
stoDaily = SmoothedStochastic[14,3](close)
TIMEFRAME(1 hour)
stoHourly = SmoothedStochastic[14,3](close)
SCREENER[stoDaily < 20 AND stoHourly < 20](stoDaily AS "Slow Sto D")

Returns instruments oversold on both the daily and hourly slow stochastic, a stricter version of the oversold condition.

Interpretation

ZoneRangeReading
Oversoldbelow 20Price has been closing near the bottom of its range. A cross back above 20 is the classic buy-side trigger.
Neutral20 to 80No positioning extreme. The 50 line is sometimes used as a bias filter.
Overboughtabove 80Price has been closing near the top of its range. A cross back under 80 is the classic sell-side trigger.

Divergences. A bearish divergence forms when price prints a higher high while the oscillator does not; a bullish divergence forms when price prints a lower low while the oscillator holds above its prior low. Both are read as early warnings that the current move is losing participation.

Common errors and gotchas

  • Expecting fast-stochastic timing. The smoothing that removes noise also adds lag. Signals arrive later than with Stochastic, which matters for short-holding-period systems.
  • Extremes persist in trends. In a strong trend the slow stochastic can sit above 80 or below 20 for many bars. Selling every overbought reading in an uptrend is a reliable way to fight the trend.
  • Bracket versus parenthesis confusion. The two periods go in square brackets and the price source in parentheses: SmoothedStochastic[14,3](close). SmoothedStochastic(14,3,close) does not compile.
  • Redundant double smoothing. Applying Average on top of an already smoothed stochastic compounds the lag. If a signal line is needed, keep its period short, typically 3.
  • Stochastic, the fast %K stochastic oscillator.
  • StochasticD, the %D signal line of the stochastic.
  • SMI, midpoint-based stochastic momentum index.
  • RSI, momentum oscillator with comparable 0 to 100 scale.
  • Williams, %R oscillator, an inverted range-position measure.
  • Highest, highest value over N bars, the range top used in the formula.
  • Lowest, lowest value over N bars, the range bottom used in the formula.
  • DynamicZoneStochasticUp, adaptive upper band for stochastic readings.
  • DynamicZoneStochasticDown, adaptive lower band for stochastic readings.