我有一些通过tq_get
的{{1}}函数从Quandl检索到的期货数据
tidyquant
我想在## list of agricultural commodities
agriculturals <- c("CHRIS/ICE_CC2", "CHRIS/ICE_KC2", "CHRIS/ICE_ICN2", "CHRIS/ICE_CT2", "CHRIS/CME_LB2", "CHRIS/CME_O2", "CHRIS/CME_S2", "CHRIS/ICE_SB2", "CHRIS/CME_LC2", "CHRIS/CME_W2", "CHRIS/CME_RR2", "CHRIS/ICE_OJ2", "CHRIS/ICE_IS2", "CHRIS/ICE_ISM2", "CHRIS/ICE_IBO2")
# build dataframe
ag <-
agriculturals %>%
tq_get(get = "quandl",
from = "2000-01-01",
collapse = "daily") %>%
select(date, symbol, everything())
软件包中使用此数据进行策略回测。据我所知,我需要使用quantstrat
函数将此数据加载到环境中,以便将数据与getSymbols
函数一起使用。有谁知道这是否可能,以及如何实现?