suppressPackageStartupMessages(library('quantmod'))
watch <- c("GOOGL","GOOG","AAPL","YHOO","FB","TWTR",'YELP','ORCL','T','AMZN','PEP','COKE',
'V','COST','AXP','BBY','KR','C','G','S','W','Z','LNKD','MSFT')
for(i in watch){
suppressMessages(getSymbols(i,src="google"))
}
#getSymbols('COF+',src="google")
#names(FB) <- gsub('FB\\.','',names(FB))
stk_plot = function(ticker,last_mon=3){
if(any(class(ticker)=='character')){
name = ticker
ticker = eval(parse(text = paste0('`',i,'`')))
}else{
name = as.character(as.list(match.call())[[2]])
}
subset = paste("last",last_mon,"months")
chartSeries(ticker,subset = subset,theme='white',multi.col = T,name=name,
TA = "addSMA(n=5,col='cyan');addSMA(n=10,col='blue');addMACD();addVo()")
}
stk_plot(COST)
stk_plot(KR)
stk_plot(`COF+`)
stk_plot(S)
stk_plot(W)
stk_plot(C)
stk_plot(Z)
for(i in watch){
suppressWarnings(stk_plot(i))
cmd = readline()
if(cmd == "s"){
stop("exit")
}
}