Why am I not able to access Bloomberg trade data outside of market hours using Datafeed Toolbox 3.2 (R2008b)?

2 views (last 30 days)
I am not able to access trade data using the following code outside of market hours. I am using the following code for this
 
c=bloomberg;
a = fetch(c,'C Equity','TIMESERIES',{'05/20/2011 04:00','05/20/2011 09:30'});
However, I am able to access the BID and ASK data without any issues. I faced a similar issue with Excel, but found a workaround for it by using the following BDH code
 
BDH("SPY US EQUITY","BID, TRADE, ASK","5/20/2011 9:00:00 AM","5/20/2011 9:29:59 AM","Dir=V","Dts=S","Sort=A","IntrRw=True","CondCodes=S","QRM=S","ExchCode=H","BrkrCodes=H","RPSCodes=H","BICMICCodes=H","Type=S","Price=S","Size=S")
"CondCodes=S"and "QRM=S" are the condition code used to display all the trades pre and post market.
When I Used, "CondCodes=H"and "QRM=H" I saw the same issue as with MATLAB.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Jan 2017
The old Bloomberg V2 API which MATLAB supports with the BLOOMBERG constructor and FETCH method, it does not support the ConditionCodes or QRM flags (or any of these flags for that matter). To get this functionality, you need to move to the new BLP constructor and TIMESERIES method that use the Bloomberg V3 API.
The syntax is
 
c = blp;
d = timeseries(c,'SPY US Equity',{'05/20/2011 09:29:57','05/20/2011 09:29:59'},[],{'BID','ASK','TRADE'},{'includeConditionCodes','includeNonPlottableEvents'},{true,true});
The includeNonPlottableEvents is the equivalent of QRM=S used in the BDH code for MS Excel.
The "includeConditionCodes" command will return a comma delimited list of exchange information. 
For more information on the support for Bloomberg V3 API see Datafeed Toolbox Version 3.5 (R2010a) release notes below:

More Answers (0)

Products


Release

R2008b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!