data(ttrc)
stoch.osc <- stochastic(ttrc[,c("High","Low","Close")])
stoch.wpr <- WPR(ttrc[,c("High","Low","Close")])
plot(tail(stoch.osc[,"fastK"], 100), type="l", main="Fast %K and Williams %R",
ylab="", ylim = range(cbind(stoch.osc, stoch.wpr), na.rm=TRUE) )
lines(tail(stoch.wpr, 100), col="blue")
lines(tail(1-stoch.wpr, 100), col="red", lty="dashed")
Run the code above in your browser using DataLab