Using the Rblapi package to pull data
Asked Answered
S

1

2

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.

enter image description here

Sundew answered 13/4, 2016 at 9:11 Comment(4)
probably because there is more than one ticker mapping to those isins. For example, CH0019597530 maps to 4 different tickers: AMGSSCHFEU, AMGSSCHFEO, AMGS SW, AMGSSCH SWBurwell
And it doesn't work in Excel eitherBurwell
Just added a screen shot from the Excel sheet. It does work in there though...Sundew
My bad, I was trying with "LU0942970442 equity", not "LU0942970442 ISIN". See my answer.Burwell
B
6

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")
Burwell answered 13/4, 2016 at 13:18 Comment(2)
Worked perfectly. ThanksSundew
Let me add to this absolute stellar finding this different option for those using ID059 (also known as BUID). This will work: bdp(paste("/BUID/", unique(thisList$ID059)), "ID_ISIN")Boohoo

© 2022 - 2024 — McMap. All rights reserved.