quantmod 的简单功能不再起作用 [英] Simple function of quantmod not working anymore

查看:34
本文介绍了quantmod 的简单功能不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我明天要交我的论文,我收到了一个非常奇怪的 quantmod 错误消息,这是我在过去几周使用这个包时从未遇到过的.我无法导入特定于道琼斯指数 (^DJI) 的数据.我收到以下错误消息:

I am turning in my thesis tomorow and I'm getting a very bizzare error message with quantmod which I never had during the last weeks while working with this package. I can't manage to import data specificly of Dow Jones index (^DJI). I get the following error message:

getSymbols("^DJI",src="yahoo", from='2005-6-01', to='2012-6-21')

Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  : 
impossible to open the URL 'http://chart.yahoo.com/table.csv?s=^DJI&a=5&b=01&c=2005&d=5&e=21&f=2012&g=d&q=q&y=0&z=^DJI&x=.csv'
Also : Message d'avis :
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  :
impossible to open : the status HTTP was '404 Not Found'

问这么简单的问题我都不好意思了.我真的不明白问题出在哪里..例如这些工作得很好

I almost feel embarased to ask such a simple question. I really don't understand where the problem is.. these for example work just fine

getSymbols("AAPL",src="yahoo", from='2005-6-01', to='2012-6-21')
getSymbols("^NDX",src="yahoo", from='2005-6-01', to='2012-6-21')

那么问题出在哪里呢?非常感谢您的帮助我真的很感激!

So where is the problem? thank you very much for your help I really appreciate it !

推荐答案

出于某种原因,雅虎目前不提供该数据.你可以看到雅虎网站它目前说指定日期范围内的历史报价数据不可用."

For some reason, yahoo does not currently provide that data. You can see on the yahoo website that it currently says "Historical quote data is unavailable for the specified date range."

我不知道这是暂时的还是永久的,但我猜是临时的,因为正如您所指出的,^ NDX"仍然有效.由于今天是美国的假期,雅虎可能正在维护.

I do not know ifthis is temporary or permanent, but I would guess that it is temparary because as you noted, "^NDX" still works. Since today is a holiday in the United States, it is possible that Yahoo is doing maintenance.

如果它在您为时已晚之前可用,我建议保存数据使用 saveFinancialInstrument::::saveSymbols.common 以便您可以使用 getSymbols(*, src='FI')

If it becomes available before it is too late for you, I would suggest saving the data either with save or with FinancialInstrument:::saveSymbols.common so that you could load it back using getSymbols(*, src='FI')

如果它在您需要的时候还没有启动,您有几个替代方案可能适合也可能不适合您的需求.您可以使用 getSymbols.FRED 获取自 1886 年以来索引的收盘值

If it's not up by the time you need it, you have a couple alternatives that may or may not suit your needs. You could use getSymbols.FRED to get the closing values of the index since 1886

getSymbols("DJIA", src='FRED')

或者,您可以使用 DIA ETF,它实际上是可交易的并且是一个不错的代理为索引

Or, you could use the DIA ETF which is actually tradeable and is a decent proxy for the index

getSymbols("DIA", src='yahoo')

这篇关于quantmod 的简单功能不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆