[R-SIG-Finance] How to get SSE Composite Index from yahoo or google?
Jeff Ryan
jeff.a.ryan at gmail.com
Sat Jan 23 05:58:56 CET 2010
Couple of options using quantmod:
library(quantmod)
> SSE <- getSymbols("000001.SS",auto.assign=FALSE)
> head(SSE)
000001.SS.Open 000001.SS.High 000001.SS.Low 000001.SS.Close
2007-01-01 2675.47 2675.47 2675.47 2675.47
2007-01-02 2675.47 2675.47 2675.47 2675.47
2007-01-03 2675.47 2675.47 2675.47 2675.47
2007-01-04 2728.19 2847.61 2684.82 2715.72
2007-01-05 2668.58 2685.80 2617.02 2641.33
2007-01-08 2621.07 2708.44 2620.62 2707.20
000001.SS.Volume 000001.SS.Adjusted
2007-01-01 0 2675.47
2007-01-02 0 2675.47
2007-01-03 0 2675.47
2007-01-04 4294967200 2715.72
2007-01-05 4294967200 2641.33
2007-01-08 4294967200 2707.20
> setSymbolLookup(SSE=list(name="000001.SS", src="yahoo"))
> getSymbols("SSE")
[1] "SSE"
> head(SSE)
000001.SS.Open 000001.SS.High 000001.SS.Low 000001.SS.Close
2007-01-01 2675.47 2675.47 2675.47 2675.47
2007-01-02 2675.47 2675.47 2675.47 2675.47
2007-01-03 2675.47 2675.47 2675.47 2675.47
2007-01-04 2728.19 2847.61 2684.82 2715.72
2007-01-05 2668.58 2685.80 2617.02 2641.33
2007-01-08 2621.07 2708.44 2620.62 2707.20
000001.SS.Volume 000001.SS.Adjusted
2007-01-01 0 2675.47
2007-01-02 0 2675.47
2007-01-03 0 2675.47
2007-01-04 4294967200 2715.72
2007-01-05 4294967200 2641.33
2007-01-08 4294967200 2707.20
HTH
Jeff
2010/1/22 邓一硕 <dengyishuo at 163.com>:
>
>
> Hi,all!
>
> Anybody know how can I get SSE Composite Index (Shanghai Composite Index)
> from yahoo or google using R?
>
> Thanks!
>
>
>
> -----
> 违背命运的人,永远不可能了解自己。
> --
> View this message in context: http://n4.nabble.com/How-to-get-SSE-Composite-Index-from-yahoo-or-google-tp1204402p1204402.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
--
Jeffrey Ryan
jeffrey.ryan at insightalgo.com
ia: insight algorithmics
www.insightalgo.com
More information about the R-SIG-Finance
mailing list