Using quantmod to obtain current Dow Jones index

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using quantmod to obtain current Dow Jones index

Fisher Dennis
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

Two questions:
        1.  Is there some way to obtain the current DJI using quantmod?
        2.  If not, can someone suggest alternatives?

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone / Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Using quantmod to obtain current Dow Jones index

Joshua Ulrich
On Wed, Sep 6, 2017 at 8:11 AM, Dennis Fisher <[hidden email]> 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
>
> ______________________________________________
> [hidden email] 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

______________________________________________
[hidden email] 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.