uire(quantmod) require(PerformanceAnalytics)
getSymbols(c('SP500','WAAA','WBAA'),src ='FRED',from ='1950-01-01') X <-na.omit(merge(to.weekly(SP500),WAAA,WBAA))
dWAAA <-diff(WAAA / 100,1) dWBAA <-diff(WBAA / 100,1)
D <-20
dP.WAAA <--D * dWAAA dP.WBAA <--D * dWBAA
charts.PerformanceSummary(p = .99,R = dP.WA