[R-SIG-Finance] Newbie question on getSymbols() in quantmod

Brian Lee Yung Rowe brian at muxspace.com
Wed Dec 31 04:31:39 CET 2008


Try:

HSBC <- getSymbols("0005.HK",src="yahoo", auto.assign=FALSE)

Brian


On Wed, 2008-12-31 at 10:58 +0800, L.-Y. Hin wrote:
> 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
> 
> _______________________________________________
> 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.



More information about the R-SIG-Finance mailing list