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