| Datafeed Toolbox™ | ![]() |
data = fetch(Connect, 'Security') data = fetch(Connect, 'Security', 'HEADER', 'Flag', 'Ident') data = fetch(Connect, 'Security', 'GETDATA', 'Fields', 'Override', 'Ident', 'Values') data = fetch(Connect, 'Security', 'TIMESERIES', 'Date', 'Minutes', 'TickField') data = fetch(Connect, 'Security', 'HISTORY, 'Fields', 'FromDate', 'ToDate', 'Period', 'Currency', 'Ident') ticker = fetch(Connect, 'SearchString', 'LOOKUP', 'Market') data = fetch(Connect, 'Security', 'REALTIME', 'Fields', MATLABProg) data = fetch(Connect, Security, 'STOP')
For a given security, fetch returns header (default), current, time-series, real time, and historical data via a connection to a Bloomberg data server.
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','Ident') returns data for the most recent date of each individual field for the specified security type identifiers, 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. Alternatively, you could use the command data = fetch(Connect,'Security').
If 'Flag' is 'TODAY', fetch returns the header field data with data from today only.
If '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', 'GETDATA', 'Fields', 'Override', 'Ident', 'Values') returns the current market data for the specified fields of the indicated security. You can further specify the data with the optional Override, Values and Ident arguments.
Note If a call to the fetch function with the GETDATA argument encounters an invalid security in a list of securities to retrieve, it returns NaN data for the invalid security's fields. |
data = fetch(Connect, 'Security', 'TIMESERIES', 'Date', 'Minutes', 'TickField') returns the tick data for a security for the specified date. You can further specify data with the optional Minutes and TickField arguments. If there is no data found in the specified range, fetch returns an empty matrix.
You can specify TickField as a string or numeric value. For example, TickField = 'Trade' or TickField = 1 returns data for ticks of type Trade. The function dftool('ticktypes') returns the list of intraday tick fields. fetch returns intraday tick data requested with an interval with the following columns:
Time
Open
High
Low
Value of last tick
Volume total value of ticks
Total value of ticks for the time range
Number of ticks
Columns 7 and 8 are returned only if they make sense for the requested field.
For today's tick data, enter the command:
data = fetch(Connect,'Security', 'TIMESERIES', now)
For today's trade time series aggregated into five-minute intervals, enter:
data = fetch(Connect,'Security','TIMESERIES', ... now, 5, 'Trade')
data = fetch(Connect, 'Security', 'HISTORY, 'Fields', 'FromDate', 'ToDate', 'Period', 'Currency', 'Ident') returns historical data for the specified field for the date range FromDate to ToDate. You can set the time period with the optional Period argument to return a more specific data set. You can further specify returned data by appending the Currency or Ident argument.
Note If a call to the fetch function with the HISTORY argument encounters an invalid security in a list of securities to retrieve, it returns no data for any securities in the list. |
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.
Note If you supply Ident without a period or currency, enter [] for the missing values. |
data = fetch(Connect, 'Security', 'REALTIME', 'Fields', MATLABProg) subscribes to a given security or list of securities, requesting the indicated fields, and runs any specified MATLAB function. See pricevol, showtrades, or stockticker for information on the data returned by asynchronous Bloomberg events.
data = fetch(Connect, Security, 'STOP') unsubscribes the list of securities from processing Bloomberg real-time events.
Retrieve header data for a United States equity with ticker ABC:
D = fetch(C,'ABC US Equity')
Retrieve the opening and closing prices:
D = fetch(C,'ABC US Equity','GETDATA',...
{'Last_Price';'Open'})
Retrieve the requested fields, given override fields and values:
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'})
Retrieve today's time series:
D = fetch(C,'ABC US Equity','TIMESERIES', now)
Retrieve today's trade time series for the given security, aggregated into five-minute intervals:
D = fetch(C,'ABC US Equity','TIMESERIES', now, 5,'Trade')
Retrieve the closing price for the given dates, using the default period of the data:
D = fetch(C,'ABC US Equity','HISTORY','Last_Price',... '8/01/99', '8/10/99')
Retrieve the monthly closing price for the specified dates:
D = fetch(C,'ABC US Equity','HISTORY','Last_Price',... '8/01/99', '9/30/00','m')
bloomberg, bloomberg.close, bloomberg.get, bloomberg.isconnection
![]() | bloomberg.close | bloomberg.get | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |