# Stochastic Momentum Index _ UCSgears

The Stochastic Momentum Index (SMI) was introduced by William Blau in 1993 as a way to clarify the traditional stochastic oscillator. SMI helps you see where the current close has taken place relative to the midpoint of the recent high to low range is based on price change in relation to the range of the price. This is a range based indicator, when used right. It can help momentum changes.

For those looking for help understanding this -

https://tlc.thinkorswim.com/center/chart...
https://www.sierrachart.com/supportboard...

オープンソーススクリプト

チャートでこのスクリプトを利用したいですか？
```//Stochastic Momentum Index
//Code by UCSgears
study("UCS_Stochastic Momentum Index", shorttitle = "UCS_SMI", overlay=false)
a = input(5, "Percent K Length")
b = input(3, "Percent D Length")
// Range Calculation
ll = lowest (low, a)
hh = highest (high, a)
diff = hh - ll
rdiff = close - (hh+ll)/2
// Nested Moving Average for smoother curves
avgrel = ema(ema(rdiff,b),b)
avgdiff = ema(ema(diff,b),b)
// SMI calculations
SMI = avgdiff != 0 ? (avgrel/(avgdiff/2)*100) : 0
SMIsignal = ema(SMI,b)
//All PLOTS
plot(SMI, title = "Stochastic Momentum Index")
plot(SMIsignal, color= red, title = "SMI Signal Line")
plot(40, color = red, title = "Over Bought")
plot(-40, color = green, title = "Over Sold")
plot(0, color = blue, title = "Zero Line")
//END```