Main Content

getbulkdata

Bulk data with header information for Bloomberg connection V3

Description

d = getbulkdata(c,s,f) returns the bulk data for the fields f for the security list s.

example

d = getbulkdata(c,s,f,o,ov) returns the bulk data using the override fields o with corresponding override values ov.

example

d = getbulkdata(c,s,f,o,ov,Name,Value) returns the bulk data with additional options specified by one or more name-value pair arguments for Bloomberg® request settings.

example

[d,sec] = getbulkdata(___) additionally returns the security list sec using any of the input argument combinations in the previous syntaxes.

example

Examples

collapse all

Create the Bloomberg connection.

c = blp;

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

Return the dividend history for IBM®.

security = 'IBM US Equity';
field = 'DVD_HIST'; % Dividend history field

[d,sec] = getbulkdata(c,security,field) 
d = 

    DVD_HIST: {{149x7 cell}}

sec = 

    'IBM US Equity'

d is a structure with one field that contains a cell array with the returned bulk data. sec contains the IBM security name.

Display the dividend history with the associated header information by accessing the structure field DVD_HIST. This field is a cell array that contains one cell array. The nested cell array contains the dividend history data. Access the contents of the nested cell using cell array indexing.

d.DVD_HIST{1}
ans = 

  Columns 1 through 6

    'Declared Date'    'Ex-Date'    'Record Date'    'Payable Date'    'Dividend Amount'    'Dividend Frequency'
    [       735536]    [ 735544]    [     735546]    [      735578]    [         0.95]      'Quarter'           
    [       735445]    [ 735453]    [     735455]    [      735487]    [         0.95]      'Quarter'           
    [       735354]    [ 735362]    [     735364]    [      735395]    [         0.95]      'Quarter'           
    ...

  Column 7

    'Dividend Type'
    'Regular Cash' 
    'Regular Cash' 
    'Regular Cash' 
    ...

The first row of the dividend history data is the header information that describes the contents of each column.

Close the connection.

close(c)

Create the Bloomberg connection.

c = blp;

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

Return the dividend history for IBM with dividend dates from January 1, 2004, through January 1, 2005.

security = 'IBM US Equity';
field = 'DVD_HIST';                        % Dividend history field
override = {'DVD_START_DT','DVD_END_DT'};  % Dividend start and 
                                           % End dates
overridevalues = {'20040101','20050101'};

[d,sec] = getbulkdata(c,security,field,override,overridevalues)
d = 

    DVD_HIST: {{5x7 cell}}

sec = 

    'IBM US Equity'

d is a structure with one field that contains a cell array with the returned bulk data. sec contains the IBM security name.

Display the dividend history with the associated header information by accessing the structure field DVD_HIST. This field is a cell array that contains one cell array. The nested cell array contains the dividend history data. Access the contents of the nested cell using cell array indexing.

d.DVD_HIST{1}
ans = 

  Columns 1 through 6

    'Declared Date'    'Ex-Date'    'Record Date'    'Payable Date'    'Dividend Amount'    'Dividend Frequency'
    [       732246]    [ 732259]    [     732261]    [      732291]    [         0.18]      'Quarter'           
    [       732155]    [ 732165]    [     732169]    [      732200]    [         0.18]      'Quarter'           
    [       732064]    [ 732073]    [     732077]    [      732108]    [         0.18]      'Quarter'           
    [       731973]    [ 731983]    [     731987]    [      732016]    [         0.16]      'Quarter'           

  Column 7

    'Dividend Type'
    'Regular Cash' 
    'Regular Cash' 
    'Regular Cash' 
    'Regular Cash'

The first row of the dividend history data is the header information that describes the contents of each column.

Close the connection.

close(c)

Create the Bloomberg connection.

c = blp;

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

Return the closing price and dividend history for IBM with dividend dates from January 1, 2004 through January 1, 2005. Specify the data return format as a character vector by setting the name-value pair argument 'returnFormattedValue' to 'true'.

security = 'IBM US Equity';
fields = {'LAST_PRICE','DVD_HIST'};        % Closing price and 
                                           % Dividend history fields
override = {'DVD_START_DT','DVD_END_DT'};  % Dividend start and 
                                           % End dates
overridevalues = {'20040101','20050101'};

[d,sec] = getbulkdata(c,security,fields,override,overridevalues,...
                      'returnFormattedValue',true)
d = 

      DVD_HIST: {{5x7 cell}}
    LAST_PRICE: {'188.74'}

sec = 

    'IBM US Equity'

d is a structure with two fields. The first field DVD_HIST contains a cell array with the dividend historical data as a cell array. The second field LAST_PRICE contains a cell array with the closing price as a character vector. sec contains the IBM security name.

Display the closing price.

d.LAST_PRICE
ans = 

    '188.74'

Display the dividend history with the associated header information by accessing the structure field DVD_HIST. This field is a cell array that contains one cell array. The nested cell array contains the dividend history data. Access the contents of the nested cell using cell array indexing.

d.DVD_HIST{1}
ans = 

  Columns 1 through 6

    'Declared Date'    'Ex-Date'    'Record Date'    'Payable Date'    'Dividend Amount'    'Dividend Frequency'
    [       732246]    [ 732259]    [     732261]    [      732291]    [         0.18]      'Quarter'           
    [       732155]    [ 732165]    [     732169]    [      732200]    [         0.18]      'Quarter'           
    [       732064]    [ 732073]    [     732077]    [      732108]    [         0.18]      'Quarter'           
    [       731973]    [ 731983]    [     731987]    [      732016]    [         0.16]      'Quarter'           

  Column 7

    'Dividend Type'
    'Regular Cash' 
    'Regular Cash' 
    'Regular Cash' 
    'Regular Cash'

The first row of the dividend history data is the header information that describes the contents of each column.

Close the connection.

close(c)

Create a Bloomberg® connection, and then request dividend history data. The getbulkdata function returns data for dates as a datetime array.

Create the Bloomberg connection.

c = blp;

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

Return data as a table by setting the DataReturnFormat property of the connection object. If you do not set this property, the getbulkdata function returns data as a structure.

Return dates as a datetime array by setting the DatetimeType property of the connection object. In this case, the table contains dates in variables that are datetime arrays.

c.DataReturnFormat = 'table';
c.DatetimeType = 'datetime';

Return the dividend history for IBM®.

s = 'IBM US Equity';
f = 'DVD_HIST'; % Dividend history field

d = getbulkdata(c,s,f);

Display the first three rows of the table.

d.DVD_HIST{1}(1:3,:)
ans =

  3×7 table

        DeclaredDate              ExmDate                RecordDate             PayableDate         DividendAmount    DividendFrequency     DividendType 
    ____________________    ____________________    ____________________    ____________________    ______________    _________________    ______________

    31-Oct-2017 00:00:00    09-Nov-2017 00:00:00    10-Nov-2017 00:00:00    09-Dec-2017 00:00:00         1.5              'Quarter'        'Regular Cash'
    25-Jul-2017 00:00:00    08-Aug-2017 00:00:00    10-Aug-2017 00:00:00    09-Sep-2017 00:00:00         1.5              'Quarter'        'Regular Cash'
    25-Apr-2017 00:00:00    08-May-2017 00:00:00    10-May-2017 00:00:00    10-Jun-2017 00:00:00         1.5              'Quarter'        'Regular Cash'

Display three declared dates. The DeclaredDate variable is a datetime array.

d.DVD_HIST{1}.DeclaredDate(1:3)
ans = 

  3×1 datetime array

   31-Oct-2017 00:00:00
   25-Jul-2017 00:00:00
   25-Apr-2017 00:00:00

Close the Bloomberg connection.

close(c)

Input Arguments

collapse all

Bloomberg connection, specified as a connection object created using blp, blpsrv, or bpipe.

Security list, specified as a character vector or string scalar for one security or a cell array of character vectors or string 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 | string

Bloomberg data fields, specified as a character vector, string scalar, cell array of character vectors, or string array. A character vector or string denotes one Bloomberg data field name. A cell array of character vectors or string array denotes multiple Bloomberg data field names. For details about the fields 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 | string

Bloomberg override field, specified as a character vector, string scalar, cell array of character vectors, or string array. A character vector or string denotes one Bloomberg override field name. A cell array of character vectors or string array denotes multiple Bloomberg override field names. For details about the fields 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 | string

Bloomberg override field value, specified as a character vector, string scalar, cell array of character vectors, or string array. A character vector or string denotes one Bloomberg override field value. A cell array of character vectors or string array denotes multiple Bloomberg override field values. Use this field value to filter the Bloomberg data result set.

Example: '20100101'

Data Types: char | cell | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'returnFormattedValue',true

Entitlement identifiers, specified as the comma-separated pair consisting of 'returnEids' and a Boolean. true adds a name and value for the entitlement identifier (EID) date to the return data.

Data Types: logical

Return format, specified as the comma-separated pair consisting of 'returnFormattedValue' and a Boolean. true forces all data to be returned as the data type character vector.

Data Types: logical

Date time format, specified as the comma-separated pair consisting of 'useUTCTime' and a Boolean. 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

Latest reference data, specified as the comma-separated pair consisting of 'forcedDelay' and a Boolean. true returns the latest data up to the delay period specified by the exchange for the security.

Data Types: logical

Output Arguments

collapse all

Bloomberg data, returned as a structure, table, or timetable. The data type of the Bloomberg data depends on the DataReturnFormat and DatetimeType properties of the connection object. For details about the data, see the Bloomberg API Developer’s Guide using the WAPI <GO> option from the Bloomberg terminal.

Security list, returned as a cell array of character vectors 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

Version History

Introduced in R2014b