# Stochastic Momentum Index _ UCSgears

59500 visualizzazioni
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...

Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Vuoi usare questo script sui tuoi grafici?
```//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```