| Datafeed Toolbox | ![]() |
Syntax
data = fetch(Connect, 'Security') data = fetch(Connect, 'Security', 'HEADER', 'Flag') data = fetch(Connect, 'Security', 'GETDATA', 'Fields') data = fetch(Connect, 'Security', 'GETDATA', 'Fields', Override, Values) data = fetch(Connect, 'Security', 'TIMESERIES', 'Date') data = fetch(Connect, 'Security', 'TIMESERIES', 'Date', Minutes, TickField) data = fetch(Connect, 'Security', 'HISTORY', 'Field', 'FromDate', 'ToDate') data = fetch(Connect, 'Security', 'HISTORY', 'Field', 'FromDate', 'ToDate', 'Period') ticker = fetch(Connect, 'SearchString', 'LOOKUP', 'Market')
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.) |
|
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. |
|
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. |
|
(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', ' returns data based upon the value of HEADER', 'Flag')
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)).
Flag is TODAY, fetch returns the header field data with data from today only.
Flag is ENHANCED, fetch returns the header field data for the most recent date of each individual field. In this case, for example, the bid and ask group fields could come from different dates.
data = fetch(Connect, 'Security', ' returns the data for the specified fields of the indicated security. You can further specify the data with the optional GETDATA', 'Fields')
Override and Values arguments.
data = fetch(Connect, 'Security', ' returns the tick data for a security for the specified date. You can further specify the data with the optional TIMESERIES', 'Date')
Minutes and TickField arguments.
For today's tick data, specify
data = fetch(Connect, 'Security', ' returns historical data for the specified field for the date range HISTORY', 'Field', 'FromDate',
ToDate)
FromDate to ToDate. You can further specify the date range by setting the time period with the optional Period argument.
ticker = fetch(Connect, 'SearchString', ' uses LOOKUP', 'Market')
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.
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
D = fetch(C,'3358ABCD4 Corp', 'GETDATA',... {'YLD_YTM_ASK','ASK','OAS_SPREAD_ASK','OAS_VOL_ASK'},... {'PX_ASK','OAS_VOL_ASK'}, {'99.125000','14.000000'})
returns the requested fields given override fields and values.
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
| close | get | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |