Documentation Center

  • Trial Software
  • Product Updates

getdata

Current Bloomberg V3 data

Syntax

Description

example

[d,sec] = getdata(c,s,f) returns the data for the fields f for the security list s.

example

[...] = getdata(...,o,ov) returns the data using the override fields o with corresponding override values ov.

example

[...] = getdata(...,Name,Value) returns the data using Name,Value pair arguments for additional Bloomberg® request settings.

Examples

expand all

Return the Closing and Open Price of the Given Security

Create the Bloomberg connection.

c = blp;

Request closing and open prices for Microsoft®.

[D,SEC] = getdata(c,'MSFT US Equity',{'LAST_PRICE';'OPEN'})
D = 
    LAST_PRICE: 33.3401
          OPEN: 33.6000

SEC = 
    'MSFT US Equity'

getdata returns a structure D with the closing and open prices. Also, getdata returns the security in SEC.

Close the connection.

close(c);

Return the Requested Fields Given Override Fields and Values

Create the Bloomberg connection.

c = blp;

Request data for Bloomberg fields YLD_YTM_ASK, ASK, and OAS_SPREAD_ASK when the Bloomberg field OAS_VOL_ASK equals 14.000000.

[D,SEC] = getdata(c,'030096AF8 Corp',...
   {'YLD_YTM_ASK','ASK','OAS_SPREAD_ASK','OAS_VOL_ASK'},...
   {'OAS_VOL_ASK'},{'14.000000'})
D = 
       YLD_YTM_ASK: 5.6763
               ASK: 120.7500
    OAS_SPREAD_ASK: 307.9824
       OAS_VOL_ASK: 14

SEC = 
    '030096AF8 Corp'

getdata returns a structure D with the resulting values for the requested fields.

Close the connection.

close(c);

Return a Request for IBM Using its CUSIP Number

Create the Bloomberg connection.

c = blp;

Request the closing price for IBM® with the CUSIP number.

D = getdata(c,'/cusip/459200101','LAST_PRICE') 
D = 
    LAST_PRICE: 182.5100

getdata returns a structure D with the closing price.

Close the connection.

close(c);

Return the Closing Price for the Security with a Pricing Source BGN

Create the Bloomberg connection.

c = blp;

Specify IBM with the CUSIP number and the pricing source BGN after the @ symbol.

D = getdata(c,'/cusip/459200101@BGN','LAST_PRICE')
D =
    LAST_PRICE: 186.81

getdata returns a structure D with the closing price.

Close the connection.

close(c);

Return the Constituent Weights Using a Date Override

Create the Bloomberg connection.

c = blp;

Return the constituent weights for the Dow Jones Index as of January 1, 2010 using a date override with the required date format YYYYMMDD.

D = getdata(c,'DJX Index','INDX_MWEIGHT','END_DT','20100101')
D = 
    INDX_MWEIGHT: {{30x2 cell}}

getdata returns a structure D with a cell array where the first column is the index and the second column is the constituent weight.

Display the constituent weights for each index.

D.INDX_MWEIGHT{1,1}
ans = 
    'AA UN'      [1.1683]
    'AXP UN'     [2.9366]
    'BA UN'      [3.9229]
    'BAC UN'     [1.0914]
    ...

Close the connection.

close(c);

Input Arguments

expand all

c — Bloomberg connectionconnection object

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

s — Security liststring | cell array

Security list, specified as a string for one security or a cell array for multiple securities. You can specify the security by name or by CUSIP, and with or without the pricing source.

Data Types: char | cell

f — Bloomberg data fieldsstring | cell array

Bloomberg data fields, specified as a Bloomberg specific string for one data field or a cell array of Bloomberg specific strings for multiple data fields. For details about the strings you can specify, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

Example: {'LAST_PRICE';'OPEN'}

Data Types: char | cell

o — Bloomberg override fieldstring | cell array

Bloomberg override field, specified as a Bloomberg specific string for one data field or a cell array of Bloomberg specific strings for multiple data fields. For details about the strings you can specify, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

Example: 'END_DT'

Data Types: char | cell

ov — Bloomberg override field valuestring | cell array

Bloomberg override field value, specified as a string for one Bloomberg override field or a cell array of strings for multiple Bloomberg override fields. Use this field value to filter the Bloomberg data result set from the getdata function.

Example: '20100101'

Data Types: char | cell

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: 'returnEids',true

'returnEids' — Entitlement identifierstrue | false

Entitlement identifiers, specified as a Boolean where true adds a name and value for the EID date to the return data.

Data Types: logical

'returnFormattedValue' — Return formattrue | false

Return format, specified as a Boolean where true forces all data to return as a data type string.

Data Types: logical

'useUTCTime' — Date time formattrue | false

Date time format, specified as a Boolean where true returns date and time values as Coordinated Universal Time (UTC) and false defaults to the Bloomberg TZDF <GO> settings of the requestor.

Data Types: logical

'forcedDelay' — Latest reference datatrue | false

Latest reference data, specified as Boolean where true returns the latest data up to the delay period specified by the exchange for the security.

Data Types: logical

Output Arguments

expand all

d — Bloomberg return datastructure

Bloomberg return data, returned as a structure with the Bloomberg data. For details about the returned data, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

sec — Security listcell array

Security list, returned as a cell array of strings for the corresponding securities in s. The contents of sec are identical in value and order to s. You can return securities with any of the following identifiers:

  • buid

  • cats

  • cins

  • common

  • cusip

  • isin

  • sedol1

  • sedol2

  • sicovam

  • svm

  • ticker (default)

  • wpk

More About

expand all

Tips

  • Bloomberg V3 data supports additional name-value pair arguments. To access further information on these additional name-value pairs, see the Bloomberg API Developer's Guide using the WAPI <GO> option from the Bloomberg terminal.

See Also

| | |

Was this topic helpful?