【问题标题】:Extracting data from Yahoo Finance, getSymbols从 Yahoo Finance 中提取数据,getSymbols
【发布时间】:2023-01-23 00:36:58
【问题描述】:

你知道 quantmod 发生了什么吗?以下代码有效,但现在不起作用。 库(量子模型) sp <- getSymbols("^GSPC", scr = "yahoo", auto.assign = FALSE)。 求大神帮忙看看怎么更新啊 谢谢!

【问题讨论】:

    标签: r return quantmod


    【解决方案1】:

    tidyquant建立在quantmod之上,正在从雅虎财经收集信息。似乎在工作。

    library(tidyquant)
    
    tq_get("^GSPC")
    
    # A tibble: 2,531 × 8
       symbol date        open  high   low close     volume adjusted
       <chr>  <date>     <dbl> <dbl> <dbl> <dbl>      <dbl>    <dbl>
     1 ^GSPC  2013-01-02 1426. 1462. 1426. 1462. 4202600000    1462.
     2 ^GSPC  2013-01-03 1462. 1465. 1456. 1459. 3829730000    1459.
     3 ^GSPC  2013-01-04 1459. 1468. 1459. 1466. 3424290000    1466.
     4 ^GSPC  2013-01-07 1466. 1466. 1457. 1462. 3304970000    1462.
     5 ^GSPC  2013-01-08 1462. 1462. 1452. 1457. 3601600000    1457.
     6 ^GSPC  2013-01-09 1457. 1465. 1457. 1461. 3674390000    1461.
     7 ^GSPC  2013-01-10 1461. 1472. 1461. 1472. 4081840000    1472.
     8 ^GSPC  2013-01-11 1472. 1473. 1468. 1472. 3340650000    1472.
     9 ^GSPC  2013-01-14 1472. 1472. 1466. 1471. 3003010000    1471.
    10 ^GSPC  2013-01-15 1471. 1473. 1464. 1472. 3135350000    1472.
    # … with 2,521 more rows
    # ℹ Use `print(n = ...)` to see more rows
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多