想做一个7月至9月的美股分析,代码如下
library(quantmod)
getSymbols("SPX")
chartSeries(SPX, subset="2016-07::2016-09")
chartSeries(SPX, up.col='green', dn.col='red', TA="addVo(); addMACD()",subset="2016-07::2016-09")
chartSeries(SPX, up.col='green', dn.col='red', TA="addVo(); addMACD(); addSMA(n=10, col='yellow'); addSMA(n=5, col='white')",subset="2016-07::2016-09")
但是提示Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
cannot open URL 'http://ichart.finance.yahoo.com/table.csv?s=SPX&a=0&b=01&c=2007&d=9&e=03&f=2016&g=d&q=q&y=0&z=SPX&x=.csv'
In addition: Warning message:
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
cannot open URL 'http://ichart.finance.yahoo.com/table.csv?s=SPX&a=0&b=01&c=2007&d=9&e=03&f=2016&g=d&q=q&y=0&z=SPX&x=.csv': HTTP status was '404 Not Found'
可是道琼斯指数用DJIA是可以顺利输出的,想请教一下是什么原因