n
periods. Developed by George C.
Lane in the late 1950s. The SMI relates the close to the midpoint of the high/low range.
Developed by William Blau in 1993.stoch(HLC, nFastK=14, nFastD=3, nSlowD=3, maType="SMA", ...) SMI(HLC, n=13, nFast=2, nSlow=25, nSig=9, maType="EMA", ...)
maType
function in case (1) above.EMA
, SMA
, etc. for moving average options; and note
Warning section. See WPR
to compare it's results to fast %K.data(ttrc)
stochOSC <- stoch(ttrc[,c("High","Low","Close")])
stochWPR <- WPR(ttrc[,c("High","Low","Close")])
plot(tail(stochOSC[,"fastK"], 100), type="l",
main="Fast %K and Williams %R", ylab="",
ylim=range(cbind(stochOSC, stochWPR), na.rm=TRUE) )
lines(tail(stochWPR, 100), col="blue")
lines(tail(1-stochWPR, 100), col="red", lty="dashed")
stochRSI <- stoch( RSI(ttrc[,"Close"]) )
Run the code above in your browser using DataLab