Back to Guides
Guide

Stochastic Momentum Index Formula, and Its Exact Range

The Stochastic Momentum Index formula worked through with round numbers, why the scale is exactly -100 to +100, and why four published versions disagree.

The Stochastic Momentum Index (SMI) measures how far the close sits from the middle of the recent high-low range, and the published formula bounds it at exactly -100 to +100. That bound falls out of the arithmetic, and it is a quick way to tell which version of the formula your platform is drawing.

Two of the published versions print a formula that cannot reach the overbought line the same page tells you to watch. Work the bound out once and you can check your own chart in a minute.

What is the Stochastic Momentum Index?

A momentum oscillator that measures how far the close sits from the middle of the recent high-low range, where the Stochastic Oscillator measures how far it sits from the bottom of that range.

TC2000's help site credits the author. It states that the indicator "was introduced by William Blau" in the January 1993 issue of Technical Analysis of Stocks & Commodities Magazine, and sums up the difference in one sentence: "SMI is similar to stochastics except that the close is calculated relative to the center of range instead of where price is relative to the range and runs from -100 to 100 instead of from 0 to 100."

What is the Stochastic Momentum Index formula?

TradingView's help page publishes it in three readable steps, with a 10-bar window and a 3-bar smoothing as its defaults:

highestLowestRange = highestHigh - lowestLow
relativeRange      = close - (highestHigh + lowestLow) / 2
smi                = 200 * (emaEma(relativeRange, lengthD) / emaEma(highestLowestRange, lengthD))

where emaEma(source, length) => ta.ema(ta.ema(source, length), length), an exponential moving average of an exponential moving average at the same length.

TC2000 publishes the same arithmetic in its own platform syntax:

200 * XAVG(XAVG(Cz - (MAXHp.z + MINLp.z) / 2, a), b) / XAVG(XAVG(MAXHp.z - MINLp.z, a), b)

with p the window for the range and a and b the two smoothing lengths. Read either one aloud and it is the same recipe: take the close minus the midpoint of the window, smooth it twice, divide by the twice-smoothed width of that window, multiply by 200.

How do you calculate the Stochastic Momentum Index? A worked example

Eight whole-number bars with a 5-bar window and 3-bar smoothing. This is an example, not a real instrument.

BarHighLowCloseHighest high (5)Lowest low (5)MidpointClose minus midpointWindow width
11049610010496100.00.08
21069810510696101.04.010
31059910110696101.00.010
410810010710896102.05.012
511010210911096103.06.014
610910110311098104.0-1.012
711210411111299105.55.513
8111106110112100106.04.012

The first four rows use a partial window, because five bars do not exist yet. On bar 8 the smoothing gives:

  • 3-bar EMA of "close minus midpoint": 3.8125, and an EMA of that again: 3.4375
  • 3-bar EMA of the window width: 12.2969, and an EMA of that again: 12.2109
  • SMI = 200 x 3.4375 / 12.2109 = 56.30

Platforms do not agree on one detail: the example above starts each exponential average from its first value. A platform that seeds its averages differently will print a slightly different number this early in the series, and the difference washes out as the series runs on.

Why is the Stochastic Momentum Index from -100 to +100 and not 0 to 100?

Because the close can be at most half the window's width away from the window's midpoint, so the numerator can never exceed half the denominator, and multiplying by 200 makes the ceiling exactly 100.

That holds through the smoothing as well. An exponential average is a weighted average with positive weights, so the smoothed numerator is still at most half the smoothed denominator. Put a window where the high and low never move and every bar closes at the high, and the formula prints 100.00. Flip every close to the low and it prints -100.00. Close at the midpoint every bar and it prints 0.00.

So TradingView's own wording, that values "typically fall within the range of +100 to -100", understates it. Values fall in that range always, by construction. TC2000 states it flatly as a property of the indicator, and TC2000 is right.

Can I put the SMI on a ChartLabs chart?

Yes. Open the chart's Indicators menu, go to the Standard list, and Stochastic Momentum Index sits under the Momentum & Oscillators heading. It draws in its own pane below the price, as the SMI line with a signal line, and the pane already carries level lines at +40, 0 and -40.

Ours uses the window's highest high and lowest low, the close minus their midpoint, two nested exponential averages on the numerator and the same two on the window width, and a multiplier of 200, which makes it the version bounded at -100 to +100. The defaults are TradingView's: a %K Length of 10, a %D Length of 3 and a Second %D Length of 3 for the two smoothing passes, and an EMA Length of 10 for the signal line. The indicator draws the lines and nothing more, so there is no automatic backtest. The testing happens on the chart, by hand.

Three near-misses sit close by. Stochastic KDJ, under the same heading, is the K, D, J variant, a different formula on a 0 to 100 scale. Stochastic Oscillator is the classic stochastic rather than this one. And the menu holds no SMI Ergodic entry, so that third indicator is not one you can add here.

Why does my Stochastic Momentum Index look different on another platform?

Because the four published versions are not the same formula. Two print the arithmetic above. One halves the multiplier. One changes the divisor.

SourceMultiplierDivisorDefaults it givesRange the formula can reach
TradingView help200Window's highest high minus lowest low%K 10, %D 3-100 to +100
TC2000 help200Window's highest high minus lowest lowExample only: period 40, smoothing 30, double smoothing 20, signal 10-100 to +100
TrendSpider learning centre100"the absolute value of the high/low range"None stated-50 to +50
LightningChart blogNot readable, the line is an imageOne bar's own high minus its own lowsetPeriodCounts(14, 3, 3, 3)Leaves -100 to +100

TrendSpider's formula sentence reads: "This difference is then divided by the absolute value of the high/low range and multiplied by 100." On the same two test windows that give the vendor form 100.00 and -100.00, that version prints 50.00 and -50.00, a ratio of exactly 2. That matters because TrendSpider's own page tells readers that "When the SMI line is above +40, it is considered overbought". On its own printed formula, +40 is 80 per cent of everything the indicator can ever reach, so a line that never touches 50 would look permanently overbought.

LightningChart's step 4 reads "Calculate the Range of High/Low Differences: HLDn = Highn – Lown", one bar's own high minus its own low, where both vendor pages use the window's highest high minus its lowest low. That swap can push the output clean out of the stated range. Take nine wide bars, high 110, low 90, close 100, followed by twenty-one narrow ones, high 110, low 109, close 110, at a 10-bar window and 3-bar smoothing. The window divisor gives 99.99. The single-bar divisor gives 103.23, outside the range TC2000 states in words on its own page. Two of that page's six steps, including the final one, are images rather than text, so its formula cannot be read without them.

What are the best Stochastic Momentum Index settings?

There is no agreed default, and the published sets are far apart. TradingView ships a 10-bar window with 3-bar smoothing. LightningChart's sample code uses setPeriodCounts(14, 3, 3, 3). TC2000's worked example runs a period of 40 with smoothing of 30 and double smoothing of 20, which is a four-fold difference in the window alone.

The window sets how far back the high and low are taken from, and the two smoothing lengths set how much of the output is an average of averages. A 40-bar window smoothed over 30 bars moves slowly enough that it may never reach a level a 10-bar window crosses often, so "SMI above +40" is a different rule on each of the three sets. Settings belong in your written rules, not left at whatever your platform shipped.

What do the +40 and -40 lines mean?

They are the levels every source names as overbought and oversold, with no published derivation behind the numbers.

TC2000 is careful about this: it says the indicator "is traditionally considered overbought above +40 and oversold below -40". TradingView says values above 40 are "often interpreted as signs of a bullish trend", LightningChart lists them as a setting in its sample code, and TrendSpider states them as fact.

A level nobody has tested on your data is a convention. If you want to know what it does on the pair and timeframe you trade, that is a thing you have to measure.

What is the difference between the SMI and the Stochastic Oscillator?

Two differences, both from TC2000's own sentence: the reference point and the scale. The SMI measures the close against the centre of the range; the Stochastic Oscillator measures it against the bottom of the range. The SMI runs from -100 to 100; the Stochastic Oscillator runs from 0 to 100.

Be careful with the claim that follows it on several pages, that the SMI is therefore "less subject to false swings" and "a more reliable indicator". TradingView, TrendSpider and LightningChart all say something along those lines, and none of the three publishes a test.

TrendSpider also offers as a difference between the two that "The stochastic oscillator generates two lines, while the SMI generates two lines and uses overbought and oversold levels to analyze the signals." The second half is a real contrast. The first half is the same number twice.

What is the difference between the SMI and the RSI?

Different inputs and different scales. The RSI is built from the size of up closes against down closes. The SMI is built from where the close sits inside a high-low window. The RSI runs 0 to 100, the SMI runs -100 to +100. They are not interchangeable and a level on one means nothing on the other.

Is the SMI the same as the SMI Ergodic indicator?

No, and the difference is checkable, because the same vendor publishes both formulas on the same help site.

TC2000's SMI Ergodic page gives:

XAVG(XAVG(C - C1, s), l) / XAVG(XAVG(ABS(C - C1), s), l)

Set that beside the SMI formula higher up. The SMI compares the close against a window of highs and lows. SMI Ergodic never looks at a high or a low at all: its input is the change from one close to the next, and its divisor is the size of that change. The two formulas share no term. TC2000 says so directly: "SMI Ergodic is calculated the same as the True Strength Index except it is a double-smoothed."

There is also no multiplier on the Ergodic formula, so it sits between -1 and +1 rather than -100 and +100, unless a platform scales it.

TrendSpider's attempt at the same question says both indicators "are derived from the Stochastic Oscillator", and in the space of two paragraphs tells readers both that "The SMI generates two lines: the SMI line and the signal line" and that "the Stochastic Momentum Index generates only one line".

Is the Stochastic Momentum Index built into MT4 or MT5?

No. Neither vendor index lists it. Both include iStochastic, the Stochastic Oscillator, and neither has a Stochastic Momentum Index. MQL4's own page puts the platform difference like this: "In MQL5, the number of built-in technical indicators has been increased from 30 to 38."

So on MetaTrader the SMI is a custom indicator rather than a built-in one.

How do you write an SMI rule you can test?

Pick one signal, not two. The published pages offer the cross of the +40 or -40 line and the cross of the SMI through its own signal line, and these fire at different times. Decide which one you are testing.

Then write down, before the first bar:

  • the three settings, since a window of 10 and a window of 40 fire at different rates
  • which bar the signal is read on, and whether you act on the close of that bar or the open of the next
  • what cancels a signal that has not been acted on
  • the stop and the target, as rules rather than as judgement calls

On that last point, know what your platform will and will not do for you. In ChartLabs the order types are market, limit and stop, with no automatic break-even and no trailing-stop type, so moving a stop to entry or trailing it behind price is something you do yourself during the replay by dragging the line on the chart. Closing a trade closes all of it, so "take half off" is not a rule you can test here. Write the exit you can actually execute.

How do you backtest the Stochastic Momentum Index step by step?

One pair, one timeframe, one date range chosen before you look at it.

  1. Write the rule down first, in the form above. Choosing it after you have seen the chart is how a test ends up describing the past rather than testing a method.
  2. Fix the settings and leave them alone for the whole run. Changing them mid-test gives you one result from several different indicators.
  3. Step through the chart bar by bar, so you only ever see what you would have seen at the time.
  4. Take every signal the rule gives, including the ones you do not like.
  5. Put costs in. Spread and commission turn a lot of small-edge rules into losing ones, and leaving them out is a common reason a test looks better than the live result that follows it. Our guide on backtesting accuracy goes through what to model.
  6. Log every trade as you go.

ChartLabs is built for this loop. You replay real historical data bar by bar, place trades by hand, and every trade saves a snapshot of the chart and your drawings as they were at entry, so you can open it later and see what you were looking at. The data is 1-minute candles built from Dukascopy data, tick-level where it is available and cleaned to remove anomalies, and the timeframes above them. For the broader method, see our beginner's guide to backtesting a strategy and the forex backtesting guide.

What should you record for each trade?

Date, direction, entry, stop, exit, and result in R. Then the parts specific to this indicator:

  • which signal fired, the level cross or the signal-line cross
  • the SMI value at entry
  • all three settings, because an SMI reading means nothing without them
  • the timeframe and the pair

An SMI number recorded without its settings cannot be compared with anything, including your own trades from a month earlier.

Where does the Stochastic Momentum Index fall apart?

It is slow. Two nested exponential averages on top of a rolling window put the output four averaging steps away from price, so turns arrive late by design.

Two charts labelled SMI are routinely not the same line, with four published versions, three stated default sets, two multipliers and two divisors. Before comparing a reading with anything, check which version your platform computes.

And the +40 and -40 levels arrive with no measurement attached, so measure them on your own data before you trade them.

Test it on your own data

Measure it on your own bars. ChartLabs gives you cleaned data from Dukascopy and bar-by-bar replay to do that by hand, with every trade logged and reviewable afterwards. One plan, $20 a month or $200 a year, everything included.

Start a free trial: 7 days, no credit card.

Related Topics

stochastic-momentum-indexindicatorsoscillatorsbacktestingtechnical-analysis