[R-SIG-Finance] RFinanceYJ and getSymbols for Yahoo Japan
Wouter Thielen
wouter at morannon.org
Sat Sep 27 13:47:29 CEST 2014
Hello all,
First of all, let me introduce myself as I am new here. I am Wouter
Thielen, from the Netherlands, and living and working in Tokyo, Japan. I
have recently enrolled as an online master's student at the University of
Washington for the CFRM program.
I have been trading stocks on the Japanese market for a year now, and have
always wanted to be able to analyze them in R. I tried the RFinanceYJ
package, but it did not work, and still does not as of yesterday, when I
updated. They seem to be inactive for over a year.
So with the newly acquired R skills (thanks prof. Yollin!) I set out to
implement a getSymbols.yahooj function that would scrape HTML pages of
price history from Yahoo Japan, and create an xts object. The code so far
can be found on my Github account:
https://github.com/wthielen/YJStocks/blob/master/getSymbols.yahooj.R
It is based on getSymbols.yahoo.R from the quantmod package, and the only
thing I changed are lines 46-108. So far it works for:
- pricing data of stocks including volumes and adjusted closes
- pricing data of indices (e.g. NI225) which does not have volumes or
adjusted closes. The code for these indices end with ".O" from what I have
seen. Please correct me if I'm wrong.
- account for stock splits
If there is anything else that this function should be able to do, please
let me know.
Hope to hear feedback from you!
Wouter
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list