【问题标题】:Is it possible to download historical futures prices (E-mini S&P) from Yahoo with quantmod?是否可以使用 quantmod 从雅虎下载历史期货价格(E-mini S&P)?
【发布时间】:2023-01-21 01:47:44
【问题描述】:

我正试图从雅虎获取 E-mini S@P 期货合约 (ticker=ES)、永续合约 (ES=F) 的历史期货价格。我在 R 中尝试了以下代码:

library(quantmod) 
getSymbols("ES=F", src = 'yahoo', from ='2020-01-01', env = data,  auto.assign = T) 
Error in as.environment(where) : no item called "ES=F" on the search list

我在 Yahoo 上看到了 E-mini 期货数据,我可以刷新它并更新: https://finance.yahoo.com/quote/ES%3DF/history?p=ES%3DF

【问题讨论】:

    标签: r


    【解决方案1】:

    到目前为止,我正在处理同样的问题,但成功率为 0。 我的代码块:

    library(quantmod)
    library(TTR)
    library(PerformanceAnalytics)
    
    **# Getting stock prices of ES=F**
    getSymbols ('ES=F', src = 'yahoo', from = '2019-01-01')
    **# Basic plot of the e-mini S&P 500 futures March 2023 contract**
    barChart(ES=F, theme = chartTheme('black'))
    

    **到目前为止我尝试过的事情:

    • 添加了反引号字符ES=F...但没有用
    • 尝试了我能想到的所有不同的股票代码(ESH3、ES_F、/ES),但 YahooAPI 需要 ES=F
    • 更改了 getSymbols 和 barChart 但这只会让我变得更糟

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-21
      • 2020-06-18
      • 1970-01-01
      相关资源
      最近更新 更多