I want to perform a function on my list, calculating the returns for my tickers. The aim is to add a column for each ticker in my list.
ticker = c("BTC-USD", "^GDAXI")
Stocks = lapply(ticker, getSymbols, source = "yahoo", auto.assign = FALSE)
names(Stocks) = ticker
Return_cal = function(x) {
x$Return_log = periodReturn(x[,1], period = "daily", type = "log")
}
How can I perform the return calculation for each element in my list, having at the end a column for each ticker?
Thank you