data(ttrc)
# Bollinger Bands
bbands <- bollingerBands( ttrc[,c("High","Low","Close")] )
# Directional Movement Index
dmi.adx <- ADX(ttrc[,c("High","Low","Close")])
# Moving Averages
ema <- EMA(ttrc[,"Close"], n=20)
sma <- SMA(ttrc[,"Close"], n=20)
# MACD
macd <- MACD( ttrc[,"Close"] )
# RSI
rsi <- RSI(ttrc[,"Close"])
# Stochastics
stoch.osc <- stochastic(ttrc[,c("High","Low","Close")])
### Note: you must have a working internet connection
### for the examples below to work!
# Fetch U.S. symbols from the internet
nyse.symbols <- stockSymbols("NYSE")
# Fetch Yahoo! Finance data from the internet
ibm <- getYahooData("IBM", 19990404, 20050607)
Run the code above in your browser using DataLab