Это было слишком долго для комментариев, поэтому вот пример возможного импорта / анализа
library(quantmod)
library(magrittr)
library(TTR)
names = c("AAPL","AMZN","ANF") ## amazon, aaple, abb & Fitc -- tickers
my_portfolio = names
stocks <- lapply(my_portfolio,function(x){
tryCatch(
{
w = getSymbols(x,auto.assign = F,warnings = F)
message(x," Collected!")
Sys.sleep(0.05)
return(w)
},
error= function(cond)return(data.frame())
)
})
names(stocks) <- my_portfolio
### analysis
stock = stocks$AAPL
# AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
# 2007-01-03 12.32714 12.36857 11.70000 11.97143 309579900 10.36364
# 2007-01-04 12.00714 12.27857 11.97429 12.23714 211815100 10.59366
# 2007-01-05 12.25286 12.31428 12.05714 12.15000 208685400 10.51822
# 2007-01-08 12.28000 12.36143 12.18286 12.21000 199276700 10.57016
# 2007-01-09 12.35000 13.28286 12.16429 13.22429 837324600 11.44823
# 2007-01-10 13.53571 13.97143 13.35000 13.85714 738220000 11.99609
rsi_ind = RSI(price = stock$AAPL.Close)
macd_ind = MACD(x = stock$AAPL.Close)
## so on