[R] Using quantmod to obtain current Dow Jones index

Joshua Ulrich josh.m.ulrich at gmail.com
Thu Sep 7 21:35:13 CEST 2017

On Wed, Sep 6, 2017 at 8:11 AM, Dennis Fisher <fisher at plessthan.com> wrote:
> R 3.4.1
> OS X
> Colleagues,
> I am just learning to use the quantmod package and I have encountered something that I don’t understand.
> This works:
>         getSymbols("^DJI")
> This does not work:
>         getQuote("^DJI”)
> It returns only NAs:
>         Trade Time Last Change % Change Open High Low Volume
>         ^DJI <NA> N/A N/A N/A N/A N/A N/A N/A
It returns NAs because that's what is in the file returned by the
Yahoo server.  Also note that getSymbols() and getQuote() use
different APIs.

getQuote("SPY") works, however.  The Dow Jones Industrial index might
not work due to restrictions on real-time data distribution by the
index provider...

> Two questions:
>         1.  Is there some way to obtain the current DJI using quantmod?

No. See above.

>         2.  If not, can someone suggest alternatives?

I don't know of any free alternatives that provide real-time data...
and I wouldn't trust them (or the Yahoo data you can download) for
anything I would risk my (or others') money on.

> Dennis
> Dennis Fisher MD
> P < (The "P Less Than" Company)
> Phone / Fax: 1-866-PLessThan (1-866-753-7784)
> www.PLessThan.com
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
R/Finance 2017 | www.rinfinance.com

More information about the R-help mailing list