Equally Weighted Reallocation of Stock Portfolio at Specific Dates According to a Signal
问题 I want to reallocate a strategy portfolio at specific dates: require(PerformanceAnalytics) require(TTR) require(quantmod) Get asset prices and obtain the daily discrete Returns tickers = c("ABI.BR","AI.PA","AIR.PA","ALV.DE","ASML.AS") getSymbols(tickers, from="2012-01-01", to="2013-12-01") close.prices = do.call(merge, lapply(tickers, function(x) Cl(get(x)))) colnames(close.prices) = c("Anheuser-Busch InBev", "L'Air Liquide","AIRBUS GROUP","Allianz","ASML HLDG") assets.ret = ROC(close.prices