Indicators/probuilder · probacktest · proorder · proscreener

SMI

SMI in ProBuilder returns the Stochastic Momentum Index, a double-smoothed oscillator locating the close relative to the high-low midpoint. Syntax, examples.

Syntax

probuilder
SMI[N, SS, DS](price)

Parameters

NameTypeDefaultDescription
Ninteger14Lookback period for the stochastic calculation, the window used to find the highest high and lowest low.
SSinteger3Period of the first exponential smoothing applied to the raw distance from the midpoint.
DSinteger5Period of the second (double) smoothing, producing the final signal-quality line.
priceprice sourcecloseThe price series measured against the range midpoint. Usually close.

Formula

code
midpoint = (Highest[N](high) + Lowest[N](low)) / 2
distance = price - midpoint
SMI = 100 * DoubleSmooth(distance) / (0.5 * DoubleSmooth(range))

DoubleSmooth applies an exponential average of period SS, then another of period DS. Because the numerator is a signed distance from the midpoint rather than the distance from the low, SMI is centred on zero and typically travels between -100 and +100.

How it works

A classic stochastic asks how close the current price is to the top of its recent range. SMI asks a subtly different question: how far is the close from the middle of that range. When price closes above the midpoint of the last N bars, SMI is positive; when it closes below, SMI is negative. The distance is then normalised by half the range so readings are comparable across instruments and volatility regimes.

The double exponential smoothing is the second distinguishing feature. Raw stochastic values are jumpy, so SMI passes the midpoint distance through two consecutive exponential averages (SS then DS). The result is a slower, cleaner line that reduces whipsaws, at the cost of some lag.

Because the output is centred on zero, the zero line itself carries meaning: crossings from negative to positive territory mark a shift of the close from the lower half to the upper half of the recent range.

Examples

Example 1, Overbought and oversold flags (Indicator)

probuilder
mySMI = SMI[14,3,5](close)
IF mySMI > 40 THEN
    // close is deep in the upper half of the range
    overbought = 1
    oversold = 0
ELSIF mySMI < -40 THEN
    // close is deep in the lower half of the range
    overbought = 0
    oversold = -1
ELSE
    overbought = 0
    oversold = 0
ENDIF
RETURN overbought, oversold

Computes a 14-period SMI with 3 and 5 period smoothing, then converts the reading into two discrete flags marking overbought and oversold states.

Example 2, Mean reversion entry with trend filter (ProOrder)

probuilder
// Buy oversold readings only while the long-term trend is up
trend = Average[200](close)
osc   = SMI[14,3,5](close)

IF NOT LongOnMarket THEN
  IF close > trend AND osc CROSSES OVER -40 THEN
    BUY 1 CONTRACT AT MARKET
  ENDIF
ELSE
  IF osc > 40 THEN
    SELL AT MARKET
  ENDIF
ENDIF

Enters when SMI leaves its oversold zone in the direction of the prevailing trend and exits once the oscillator reaches the overbought zone.

Example 3, Oversold scan (ProScreener)

probuilder
osc = SMI[14,3,5](close)
SCREENER[osc < -40](osc AS "SMI 14")

Lists only instruments whose SMI is below -40, sorted by the indicator value.

Interpretation

ZoneRangeReading
OverboughtSMI > +40The close sits near the top of the recent range on a smoothed basis. Momentum is strong but stretched.
Neutral-40 to +40No pronounced positioning within the range. Zero-line crossings indicate a change of side.
OversoldSMI < -40The close sits near the bottom of the recent range. Often precedes stabilisation, not guaranteed reversal.

Divergences between SMI and price are the signal the indicator was designed to highlight: a new price high without a new SMI high suggests fading momentum. The midpoint construction tends to make these divergences more visible than on a standard stochastic.

Common errors and gotchas

  • Wrong scale assumptions. SMI is not bounded 0 to 100 like Stochastic. It oscillates around zero, so thresholds such as 20/80 make no sense here. Use +40/-40 or values calibrated to the instrument.
  • Parameter order. The three bracket parameters are lookback, first smoothing, second smoothing, in that order. Swapping SS and DS produces a different, usually noisier, line with no compiler warning.
  • Lag from double smoothing. Two consecutive exponential averages delay the signal. With large SS and DS values, zone exits can trigger many bars after the actual turn.
  • Persistent extremes in trends. Like all range-based oscillators, SMI can hold above +40 for long stretches in a strong uptrend. Fading extreme readings without a trend filter is a common backtest trap.
  • Stochastic, the classic %K oscillator SMI refines.
  • StochasticD, the %D signal line of the stochastic oscillator.
  • SmoothedStochastic, the slow stochastic variant.
  • RSI, momentum oscillator bounded 0 to 100.
  • CCI, deviation-from-average oscillator with a similar centred scale.
  • Momentum, raw unbounded momentum measure.
  • Williams, %R oscillator, another range-position measure.
  • ExponentialAverage, the smoothing method used twice inside SMI.