Stochastic Momentum Index: Stochastic measured from the midpoint of the range instead of from its low.

That single change is what re-centres the study on zero and lets it say which half of the range price is in, rather than only how high in it. Both the distance from the midpoint and the range itself are double-smoothed before being divided, which is why the reading is far steadier than a raw %K.

A bare highest(lengthK) / lowest(lengthK) upstream defaults to high and low, not to the source of the surrounding expression, so the window really is a high/low range and not a close-only one.