【问题标题】:R/quantmod using getSymbols to get closed prices from csv file with specified dateR/quantmod 使用 getSymbols 从指定日期的 csv 文件中获取收盘价
【发布时间】:2017-03-07 15:44:24
【问题描述】:

尝试从 csv 中列出的代码列表中获取收盘价。文件使用以下代码:

date <- "2017-03-03"
tickers <- read.csv("us_tickerfeed.csv", header = TRUE)

for(i in 1:nrow(tickers)){
    data <- getSymbols(tickers$ticker_th[i], from = date, to = date, src = "yahoo")
    tickers$close_price[i] <- Cl(get(data))[[1]]
}

这些代码以前有效,但现在我收到以下错误消息:

do.call(paste("getSymbols.", symbol.source, sep = ""), list(Symbols = current.symbols, 中的错误: 找不到函数“getSymbols.6”

谢谢!

【问题讨论】:

  • 请将sessionInfo()getDefaults()getSymbolLookup() 的输出添加到您的问题中。

标签: r csv quantmod


【解决方案1】:

我之前也遇到过这个问题,可以试试as.character(tickers$ticker_th)吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-08
    • 1970-01-01
    • 2018-11-25
    • 1970-01-01
    • 2021-10-04
    • 1970-01-01
    • 1970-01-01
    • 2011-07-31
    相关资源
    最近更新 更多