lookup

Lookup to find information about securities for Bloomberg connection V3

Syntax

  • l = lookup(c,q,reqtype,Name,Value) example

Description

example

l = lookup(c,q,reqtype,Name,Value) retrieves data based on criteria in the query q for a specific request type reqtype using the Bloomberg® connection c. For additional information about the query criteria and the possible name-value pair combinations, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

Examples

expand all

Look Up a Security

Use the Security Lookup to retrieve information about the IBM® corporate bond. For details about Bloomberg and the parameter values you can set, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

Connect to Bloomberg.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE® using bpipe.

Retrieve the instrument data for an IBM corporate bond with a maximum of 20 rows of data.

insts = lookup(c,'IBM','instrumentListRequest','maxResults',20,...
               'yellowKeyFilter','YK_FILTER_CORP',...
               'languageOverride','LANG_OVERRIDE_NONE')
insts = 
  
         security: {20x1 cell}
      description: {20x1 cell}

The Security Lookup returns the security names and descriptions.

Display the IBM corporate bond names.

insts.security
ans = 
  'IBM<corp>'
  'IBM GB USD SR 10Y<corp>'
  'IBM GB USD SR 3Y<corp>'
  'IBM GB USD SR 30Y<corp>'
  'IBM GB USD SR 5Y<corp>'
  'IBM CDS USD SR 5Y<corp>'
  'BL037645<corp>'
  'IBM CDS USD SR 3Y<corp>'
  'IBM CDS USD SR 1Y<corp>'
  'BL106695<corp>'
  'IBM CDS USD SR 10Y<corp>'
  'IBM CDS USD SR 4Y<corp>'
  'IBM CDS USD SR 6Y<corp>'
  'IBM CDS USD SR 30Y<corp>'
  'IBM CDS USD SR 7Y<corp>'
  'IBM CDS USD SR 15Y<corp>'
  'BF106693<corp>'
  'IBMTR<corp>'
  'IBM CDS USD SR 2Y<corp>'
  'IBM CDS USD SR 0M<corp>'

Display the IBM corporate bond descriptions.

insts.description
ans = 
    'International Business Machines Corp (Multiple Matches)'
    'International Business Machines Corp Generic Benchmark 10Y Corporate'
    'International Business Machines Corp Generic Benchmark 3Y Corporate'
    'International Business Machines Corp Generic Benchmark 30Y Corporate'
    'International Business Machines Corp Generic Benchmark 5Y Corporate'
    'International Business Machines Corp'
    'IBM Loan USD REV 11/10/2017'
    'International Business Machines Corp'
    'International Business Machines Corp'
    'IBM Loan JPY TL 06/30/2017'
    'International Business Machines Corp'
    'International Business Machines Corp'
    'International Business Machines Corp'
    'International Business Machines Corp'
    'International Business Machines Corp'
    'International Business Machines Corp'
    'IBM Loan JPY DEAL 06/30/2017'
    'IBM Corp-Backed Interest Rate Putable Underlying Trust 2006-2'
    'International Business Machines Corp'
    'International Business Machines Corp'

Close the Bloomberg connection.

close(c)

Look Up a Curve

Use the Curve Lookup to retrieve information about the 'GOLD' related curve 'CD1016'. For details about Bloomberg and the parameter values you can set, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

Connect to Bloomberg.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Retrieve the curve data for the credit default swap subtype of corporate bonds for a 'GOLD' related curve 'CD1016'. Return a maximum of 10 rows of data for the U.S. with 'USD' currency.

curves = lookup(c,'GOLD','curveListRequest','maxResults',10,...
                'countryCode','US','currencyCode','USD',...
                'curveid','CD1016','type','CORP','subtype','CDS')
curves = 
  
            curve: {'YCCD1016 Index'}
      description: {'Goldman Sachs Group Inc/The'}
          country: {'US'}
         currency: {'USD'}
          curveid: {'CD1016'}
             type: {'CORP'}
          subtype: {'CDS'}
        publisher: {'Bloomberg'}
            bbgid: {''}

One row of data displays as Bloomberg curve name 'YCCD1016 Index' with Bloomberg description 'Goldman Sachs Group Inc/The' in the U.S. with 'USD' currency. The Bloomberg short-form identifier for the curve is 'CD1016'. Bloomberg is the publisher and the bbgid is blank.

Close the Bloomberg connection.

close(c)

Look Up a Government Security

Use the Government Security Lookup to retrieve information for United States Treasury bonds. For details about Bloomberg and the parameter values you can set, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

Connect to Bloomberg.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Filter government security data with ticker filter of 'T' for a maximum of 10 rows of data.

govts = lookup(c,'T','govtListRequest','maxResults',10,...
               'partialMatch',false)
govts = 
  
      parseky: {10x1 cell}
         name: {10x1 cell}
       ticker: {10x1 cell}

The Government Security Lookup returns parseky data, the name and ticker of the United States Treasury bonds.

Display the parseky data.

govts.parseky
ans = 
    '912828VS Govt'
    '912828RE Govt'
    '912810RC Govt'
    '912810RB Govt'
    '912828VU Govt'
    '912828VV Govt'
    '912828VB Govt'
    '912828VR Govt'
    '912828VW Govt'
    '912828VQ Govt'

Display the names of the United States Treasury bonds.

govts.name
ans = 
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'
    'United States Treasury Note/Bond'

Display the tickers of the United States Treasury bonds.

govts.ticker
ans = 
    'T'
    'T'
    'T'
    'T'
    'T'
    'T'
    'T'
    'T'
    'T'
    'T'

Close the Bloomberg connection.

close(c)

Input Arguments

expand all

c — Bloomberg connectionconnection object

Bloomberg connection, specified as a connection object created using blp.

q — Keyword querystring

Keyword query, specified as a string containing one or more strings for each item for which information is requested. For example, the keyword query string can be a security, a curve type, or a filter ticker.

Data Types: char

reqtype — Request type'instrumentListRequest' | 'curveListRequest' | 'govtListRequest'

Request type, specified as the above enumerated strings to denote the type of information request. 'instrumentListRequest' denotes a security or instrument lookup request. 'curveListRequest' denotes a curve lookup request. 'govtListRequest' denotes a government lookup request for government securities.

Data Types: char

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'maxResults', 20, 'yellowKeyFilter', 'YK_FILTER_CORP', 'languageOverride', 'LANG_OVERRIDE_NONE', 'countryCode', 'US', 'currencyCode', 'USD', 'curveid', 'CD1016', 'type', 'CORP', 'subtype', 'CDS', 'partialMatch', false

'maxResults' — Number of rows in result datascalar

Number of rows in the result data, specified as a scalar to denote the total maximum number of rows of information to return. Result data can be one or more rows of data no greater than the number specified.

Data Types: double

'yellowKeyFilter' — Bloomberg yellow key filterstring

Bloomberg yellow key filter, specified as a unique string to denote the particular yellow key for government securities, corporate bonds, equities, and commodities, for example.

Data Types: char

'languageOverride' — Language overridestring

Language override, specified as a unique string to denote a translation language for the result data.

Data Types: char

'countryCode' — Country codestring

Country code, specified as a string to denote the country for the result data.

Data Types: char

'currencyCode' — Currency codestring

Currency code, specified as a string to denote the currency for the result data.

Data Types: char

'curveID' — Bloomberg short-form identifier for curvestring

Bloomberg short-form identifier for a curve, specified as a string.

Data Types: char

'type' — Bloomberg market sector typestring

Bloomberg market sector type corresponding to the Bloomberg yellow keys, specified as a string.

Data Types: char

'subtype' — Bloomberg market sector subtypestring

Bloomberg market sector subtype, specified as a string to further delineate the market sector type.

Data Types: char

'partialMatch' — Partial match on tickertrue | false

Partial match on ticker, specified as true or false. When set to true, you can filter securities by setting q to a query string such as 'T*'. When set to false, the securities are unfiltered.

Data Types: logical

Output Arguments

expand all

l — Lookup informationstructure

Lookup information, returned as a structure containing set properties depending on the request type. For a list of properties and their description, see the following tables.

The properties for the 'instrumentListRequest' request type are as follows.

PropertyDescription

security

Security name

description

Security long name

The properties for the 'curveListRequest' request type are as follows.

PropertyDescription

curve

Bloomberg curve name

description

Bloomberg description

country

Country code

currency

Currency code

curveid

Bloomberg short-form identifier for the curve

type

Bloomberg market sector type

subtype

Bloomberg market sector subtype

publisher

Bloomberg is the publisher

bbgid

Bloomberg identifier

The properties for the 'govtListRequest' request type are as follows.

PropertyDescription

parseky

Bloomberg security identifier (ticker or CUSIP, for example), price source, and source key (Bloomberg yellow key).

name

Government security name

ticker

Government security ticker

Was this topic helpful?