Datafeed Toolbox    
fetch

Request data from Bloomberg

Syntax

Arguments

Connect
Bloomberg connection object created with the bloomberg command.
Security
A MATLAB string containing the name of a security in a format recognizable by the Bloomberg server. (Note: For header data only, Security may be a cell array of strings containing a list of securities.)
Flag
A MATLAB string indicating the dates from which data is to be retrieved. Possible values are:

DEFAULT: Data from most recent bid, ask, or trade. If a Flag value is not specified, 'DEFAULT' is assumed.

TODAY: Today's data only.

ENHANCED: Data from most recent date of each individual field.
Fields
A MATLAB string or cell array of strings indicating specific fields for which data is to be provided. Valid field names are in the file @bloomberg/bbfields.mat. The variable bbfieldnames contains the list of field names.
Date
Date string or serial date number indicating date for the time series. Specify now for today's time series data.
FromDate
Beginning date for historical data.
ToDate
End date for historical data.
Market
A MATLAB string indicating the market in which a particular security trades. Market values are:

Comdty    (Commodities)
Corp      (Corporate bonds)
Curncy    (Currencies)
Equity    (Equities)
Govt      (Government bonds)
Index     (Indexes)
M-Mkt     (Money Market securities)
Mtge      (Mortgage-backed securities)
Muni      (Municipal bonds)
Pfd       (Preferred stocks)

Description

For a given security, fetch returns header (default), field, time series, and historical data via the Bloomberg connection

data = fetch(Connect, 'Security') fills the header fields with data from the most recent date with a bid, ask, or trade.

data = fetch(Connect, 'Security', 'HEADER', 'Flag') returns data based upon the value of Flag.

data = fetch(Connect, 'Security', 'GETDATA', 'Fields') returns the data for the specified fields of the indicated security.

data = fetch(Connect, 'Security', 'TICKS') returns today's tick data.

data = fetch(Connect, 'Security', 'TIMESERIES', 'Date') returns the tick data for a security for the specified date. For today's tick data, specify

data = fetch(Connect, 'Security', 'HISTORY', 'Field', 'FromDate', ToDate) returns historical data for the specified field for the date range FromDate to ToDate.

ticker = fetch(Connect, 'SearchString', 'LOOKUP', 'Market') uses SearchString to find the ticker symbol for a security trading in a designated market. The output ticker is a column vector of possible ticker values.

Examples

For a United States equity with ticker ABC:

returns the header data.

returns the opening and closing prices.

return today's time series.

returns the closing price for the given dates.

See Also

bloomberg, close, get, isconnection


  close get