Rblp / Rblpapi

R package interfacing the Bloomberg API from https://www.bloomberglabs.com/api/
Other
167 stars 75 forks source link

BChain function #259

Open tryfonch opened 6 years ago

tryfonch commented 6 years ago

Is there a way to implement the Excel's BChain Function?

jan-pieter-L commented 6 years ago

I agree that this would be very valuable. The BOND_CHAIN override that can currently still be used in the BDS function will soon beprecated meaning that it would become impossible to extract outstanding bonds for an equity.

eddelbuettel commented 6 years ago

Careful code contributions are always welcome!

auenbauer commented 6 years ago

The following code works for me to get all bonds by equity ticker. Do I understand jan-pieter correctly that this will no longer work in the future? Why not?

bds("ETP US Equity", "BOND_CHAIN") Bloomberg Identifier Ticker/Coupon/Maturity 1 AQ017964 Corp ETP 6.250 01/01/01 2 EJ927720 Corp ETP 5.361 11/01/66 3 AS970828 Corp ETP 6.000 06/15/48 4 AS970843 Corp ETP 4.950 06/15/28 5 AQ019449 Corp ETP 6.625 01/01/01 ...

What I did not find out yet was how and if I could get the LOANS by using BDPloans" with bdp by equity ticker and my understanding is that this works using the Rblpapi::bdp() function.

My understanding is that this works in Excel by using the formula:

=Bchain("IBM US Equity","LOANS","LN_ISSUE_STATUS == SIGNED AND LOAN_TYP == TERM")

auenbauer commented 6 years ago

Sorry if that is off topic but I found in the documentation for the Excel Bchain function that it is based on the SRCH engine (as per April 2016) and that if a query can't be "structured" in SRCH, that you will not be able to pull it via Bchain either. So my conclusion is that a work around is to structure a SRCH and then pull the CUSIPs by Rblpapi::bsrch() and take it from there..