getSymbols.google: Download OHLC Data From Google Finance

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Downloads Symbols to specified env from ‘finance.google.com’. This method is not to be called directly, instead a call to getSymbols(Symbols,src='google') will in turn call this method. It is documented for the sole purpose of highlighting the arguments accepted, and to serve as a guide to creating additional getSymbols ‘methods’.

Usage

1
2
3
4
5
6
getSymbols.google(Symbols,
                 env,
                 return.class = 'xts',
                 from = "2007-01-01",
                 to = Sys.Date(),
                 ...)

Arguments

Symbols

a character vector specifying the names of each symbol to be loaded

env

where to create objects. (.GlobalEnv)

return.class

class of returned object

from

Retrieve no earlier than this date

to

Retrieve though this date

...

additional parameters

Details

Meant to be called internally by getSymbols (see also).

One of a few currently defined methods for loading data for use with quantmod. Essentially a simple wrapper to the underlying Google Finance site for historical data.

A word of warning. Google is the home of BETA, and historic data is no exception. There is a BUG in practically all series that include the dates Dec 29,30, and 31 of 2003. The data will show the wrong date and corresponding prices. This essentially makes it useless, but if they ever apply a fix the data is nice(r) than Yahoo, in so much as it is all split adjusted and there is forty years worth to be had. As long as you skip the holiday week of 2003. : )

Value

A call to getSymbols.google will load into the specified environment one object for each Symbol specified, with class defined by return.class. Presently this may be ts, its, zoo, xts, or timeSeries.

Note

As mentioned in the details section, a serious flaw exists within the google database/SQL. A caution is issued when retrieving data via this method if this particular error is encountered, but one can only wonder what else may be wrong. Caveat emptor.

Author(s)

Jeffrey A. Ryan

References

Google Finance: http://finance.google.com

See Also

getSymbols, setSymbolLookup

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# All 3 getSymbols calls return the same
# MSFT to the global environment
# The last example is what NOT to do!

## Method #1
getSymbols('MSFT',src='google')


## Method #2
setDefaults(getSymbols,src='google')
  # OR
setSymbolLookup(MSFT='google')

getSymbols('MSFT')

#########################################
##  NOT RECOMMENDED!!!
#########################################
## Method #3
getSymbols.google('MSFT',verbose=TRUE,env=globalenv())

## End(Not run)

R-Finance/quantmod documentation built on May 9, 2017, 9:41 p.m.