Datafeed Toolbox Previous page   Next Page
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.
Override
(Optional) Override field list.
Values
(Optional) Override field values.
Date
Date string or serial date number indicating date for the time series. Specify now for today's time series data.
Minutes
(Optional) Tick interval in minutes.
TickField
(Optional) The field can be specified as a string or numeric value (e.g., F = 'Trade' or F = 1 return data for ticks of type Trade. Use the command dftool('ticktypes') to return the list of intraday tick fields.
FromDate
Beginning date for historical data.
ToDate
End date for historical data.
Period
(Optional) Period of the data:
'd' - daily,
'w' - weekly,
'm' - monthly,
'q' - quarterly,
'y' - yearly.
If Period is not specified, the default period for the data is used.
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.

If Flag is DEFAULT, fetch fills the header fields with data from the most recent date with a bid, ask, or trade. (This is the equivalent of data = fetch(Connect, Security)).

data = fetch(Connect, 'Security', 'GETDATA', 'Fields') returns the data for the specified fields of the indicated security. You can further specify the data with the optional Override and Values arguments.

data = fetch(Connect, 'Security', 'TIMESERIES', 'Date') returns the tick data for a security for the specified date. You can further specify the data with the optional Minutes and TickField arguments.

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. You can further specify the date range by setting the time period with the optional Period argument.

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

Returning Header Data

returns the header data for a United States equity with ticker ABC.

Opening and Closing Prices

returns the opening and closing prices.

Override Fields

returns the requested fields given override fields and values.

Time Series

return today's time series.

Time Intervals

returns today's trade time series for the given security aggregated into five-minute intervals.

Default Closing Price

returns the closing price for the given dates using the default period of the data.

Monthly Closing Price

returns the monthly closing price for the given dates for the given security.

See Also

bloomberg, close, get, isconnection


Previous page  close get Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS