Я пытаюсь получить совокупный доход для каждого ETF на графике в первом окне, он не работает, см. Код ниже.
library(quantmod)
library(performanceAnalytics)
enter code here
library(PerformanceAnalytics)
startDate = as.Date("2018-01-01") #Specify period of time we are interested in
endDate = as.Date("2020-01-27")
symbols <- c("STW.AX","SPY","VGS.AX","TLT","QQQ","FXI","IWM","SLV","SMH"))
getSymbols(symbols)
#rstw<-(dailyReturn(na.omit(STW.AX)))Australian shares have missing data so make vector row
unneven
#rvgs<- (dailyReturn(na.omit(VGS.AX)))
rspy<-(dailyReturn(SPY))
rtlt<-(dailyReturn(TLT))
rslv<-(dailyReturn(SLV))
rsmh<- (dailyReturn(SMH))
stockr <- c(rspy,rtlt,rslv,rsmh)
pf<- data.frame(rspy,rtlt,rqqq,rfxi,riwm,rslv,rsmh)
charts.PerformanceSummary(stockr,main='Stock Performance',legend.loc="bottomright")
charts.PerformanceSummary(stockr[,1:4],main='Stock Performance',legend.loc="bottomright")