[R-SIG-Finance] Newbie question on getSymbols() in quantmod
L.-Y. Hin
lyhin at netvigator.com
Wed Dec 31 03:58:07 CET 2008
Dear gurus,
I am learning the quantmod library, and trying to download
the equity series for HSBC from yahoo.
I checked from yahoo finance that the symbol is 0005.HK,
and then I used
> library(quantmod)
> getSymbols("0005.HK",src="yahoo")
[1] "0005.HK"
> candleChart(0005.HK)
Error: unexpected symbol in "candleChart(0005.HK"
> chartSeries(0005.HK)
Error: unexpected symbol in "chartSeries(0005.HK"
> Cl(0005.HK)
Error: unexpected symbol in "Cl(0005.HK"
It seems like probably no data has been loaded by the
approach above.
However, the same scripts work for NYSE equities like
> getSymbols("A",src="yahoo")
[1] "A"
> chartSeries(A)
> length(Cl(A)) #To check whether OHLC data has been loaded
[1] 503
I suspect the problem is in the way I tried to load 0005.HK....
I'll be very grateful for your kind advice.
Many thanks
Lin
More information about the R-SIG-Finance
mailing list