0

I am trying to extract income statements from Google using quantmod. It works perfectly fine with US stocks but I ran into trouble when I tried non-US stocks (e.g. stocks from Hong Kong). For example:

#US stocks: (no issues here) 
library(quantmod)

getFin("AAPL") #Get financial statement for Apple, symbol ="AAPL"
head(viewFin(AAPL.f, "IS", "Q"))

# HK stocks: 

getFin('0005:HKG') #Get financial statement for HSBC , symbol ="0005.HKG" 
viewFin(0005:HKG.f, "IS", "Q")

The following error appears if I use a Hong Kong stock

Error in inherits(x, "financials") : object 'HKG.f' not found

How do I get around this problem ? Thanks in Advance

Adrien
  • 151
  • 1
  • 8

1 Answers1

1

The symbol, other way round...

getFin('HKG:0005')
str(HKG.0005.f)
viewFin(HKG.0005.f,"BS")
viewFin(HKG.0005.f,"IS")
viewFin(HKG.0005.f,"CF")
pranav
  • 96
  • 2
  • 9