MATLAB: How to retrieve historic, intraday values for specific prices from Bloomberg using datafeed

askbidbloombergDatafeed Toolboxhistoricintradaypricetimeseriestrade

I would like to use the Datafeed toolbox to retrieve historic, intraday prices from Bloomberg. However, I would also like to get certain prices, such as 'Bid' and 'Ask' as well as 'Trade' prices.

Best Answer

For raw intraday tick requests, all ticks are returned and the user will need to filter out the ticks they want.
For example,
D = fetch(c,'ABC US Equity','TIMESERIES','12/10/2008','12/15/2008');
I = (D(:,1) == 1 | D(:,1) == 31 | D(:,1) == 32);
D(~I,:) = [];
This will filter out any ticks that are not Trade, Bid Best, or Ask Best. The command
x = dftool('ticktypes')
returns the list of tick types that can be converted to numeric tick type values with, for example,
find(strcmp('Trade',x))
Trade == 1, Bid Best == 31 and Ask Best == 32.
The intraday tick fields are different from the current and historical data fields. This is the way Bloomberg maps them.
Also,
The best way to request a range is to include the timestamps in the dates, for example.
D = fetch(c,'SPX Index','TIMESERIES',{'12/05/2008 00:00:00','01/05/2009 23:59:59'});
The second column is the date/timestamp. The user should use the entire date/timestamp input form to get the right output date/times.