Using the Rblapi package to pull data

▼魔方 西西 提交于 2020-01-16 04:35:08

问题


I have a list of ISINs which is my only source of information. In Excel I can catch the Bloomber ticker which is needed in many cases because it specifies the code of the exchange on which the asset is traded. To do so I only have to add "... Equity isin" in a BDP()-Formula where "..." is a placeholder for the ISIN. So with the new Rblpapi package (which is by the way a fantastic tool!) I can try to do the same:

Here is a list of random ISINs

isins = c("LU0942970442", "LU0997545750"  ,"CH0019597530" , "CH0017142719"  , "CH0131872431", "VGG0475N1087", "US46429B6974", 
"LU0911032141"  , "DE000A1JCWS9")

adding "equity" and calling "TICKER_AND_EXCH_CODE" within the bdp formula

require(Rblpapi)
blpConnect()    

portfolio_ticker = bdp(paste(c(isins),"equity"), "TICKER_AND_EXCH_CODE")

however leaves some Tickers unspecified.

> portfolio_ticker
                    TICKER_AND_EXCH_CODE
LU0942970442 equity              XBAC SW
LU0997545750 equity           AXESZHD LX
CH0019597530 equity                     
CH0017142719 equity                     
CH0131872431 equity                     
VGG0475N1087 equity           ARIASII VI
US46429B6974 equity                     
LU0911032141 equity           FCEUSMI LX
DE000A1JCWS9 equity           CHOMCAR GR

My question is: Is this a thinking-error on my side or is this a bug in the package?

EDIT: As an example how it looks on my side in Excel, here is the corresponding picture.


回答1:


Rblpapi uses the C API - to query isins you need to format them like this:

/isin/THE_ISIN_HERE

So in your example, this should work:

bdp("/isin/LU0942970442", "TICKER_AND_EXCH_CODE")


来源:https://stackoverflow.com/questions/36593697/using-the-rblapi-package-to-pull-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!