getSymbols.yahooj: Download OHLC Data From Yahoo! Japan Finance

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

Description

Downloads Symbols to specified env from ‘finance.yahoo.co.jp’. This method is not to be called directly, instead a call to getSymbols(Symbols,src='yahooj') 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
7
getSymbols.yahooj(Symbols,
                  env,
                  return.class = 'xts',
                  index.class  = 'Date',
                  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

index.class

class of returned object index (xts only)

from

Retrieve data no earlier than this date. (2007-01-01)

to

Retrieve data through this date (Sys.Date())

...

additional parameters

Details

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

One of the few currently defined methods for loading data for use with quantmod. Essentially a simple wrapper to the underlying Yahoo! Japan finance site's historical data download.

The string ‘YJ’ will be prepended to the Symbols because Japanese ticker symbols usually start with a number and it is cumbersome to use variable names that start with a number in the R environment.

It is recommended to prepend the ticker symbols with ‘YJ’ yourself if you use setSymbolLookup. That will make it possible for the main getSymbols function to find the symbols in the lookup table.

Value

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

In the case of xts objects, the indexing will be by Date. This can be altered with the index.class argument. See indexClass for more information on changing index classes.

Author(s)

Wouter Thielen

References

Yahoo! Japan Finance: http://finance.yahoo.co.jp

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
24
25
26
27
## Not run: 
# All 4 getSymbols calls return the same
# Sony (6758.T) OHLC to the global environment
# The last example is what NOT to do!

## Method #1
getSymbols('6758.T',src='yahooj')


## Method #2
getSymbols('YJ6758.T',src='yahooj')


## Method #3
setDefaults(getSymbols,src='yahooj')
  # OR
setSymbolLookup(YJ6758.T='yahooj')

getSymbols('YJ6758.T')

#########################################
##  NOT RECOMMENDED!!!
#########################################
## Method #4
getSymbols.yahooj('6758.T',env=globalenv())

## End(Not run)

quantmod documentation built on April 13, 2018, 5:03 p.m.