Poita
Poita

Reputation: 3

Using BLPAPI to gather all RED pairs, Tiers and Doc Clause. REDL

I’ve been able to use the BLPAPI to grab from single securities such ex: “CATT1U5 CMAN Security”, their RED id, Maturity, tier and Doc clause using the /refdata service. But I’d like to be able to know the name of all securities available that have these fields so I can grab a complete list of these fields currently available in the market.

I’ve tried using the Apiflds service but with no result.

Does anyone know how to iterate through all possible securities?

I’ve also tried using the screen “REDL ” but it has no export option.

Upvotes: 0

Views: 135

Answers (1)

Beast Legend Tank
Beast Legend Tank

Reputation: 141

Why not pull an index?

Type CDS in the terminal, grab an index, and pull its members? You can also type CRVF and under credit find a CDS index. EX: MARKIT CDX.NA.IG.41 12/28 which is the IG 5Y CDS index, has an index ID of IBOXUMAE CBBT Curncy

API field Indx_members

from xbbg import blp
import pdblp


df = blp.bds('IBOXUMAE CBBT Curncy','INDX_MEMBERS')
sample_ids = df.head(10)

con = pdblp.BCon()
con.start()

con.ref(list(sample_ids['column___4'] + " MSG1 Curncy"), ['CDS_RED_PAIR_CODE','NAME','MATURITY']).pivot(values='value',columns='field',index='ticker')

enter image description here

You can pass that column in again and pull specific API fields for each security.

The RED Id is simply the "pair code". Pass the Security ID (Column___4) and get red pair code. I don't have Server API so no reference data for me. But, it'll work for you. Pass the IDs and append " Curncy" and you're good to go

enter image description here

Upvotes: 0

Related Questions