I'm trying to pull in specific data fields from the Bloomberg Java API. I see from the developers guide that I can pull in some fields with:
Request request = refDataSvc.createRequest("ReferenceDataRequest");
request.getElement("securities").appendValue("AAPL US Equity");
request.getElement("securities").appendValue("IBM US Equity");
request.getElement("fields").appendValue("PX_LAST"); // Last Price
request.getElement("fields").appendValue("DS002"); // Description
request.getElement("fields").appendValue("VWAP_VOLUME");
session.sendRequest(request, new CorrelationID(1));
How can I make a call like this while getting some of the fields over a specific date range? For example, I would like to get the: last trade price, last trade volume, the opening price for August 27th, 2012, and the VWAP volume for August 26th between 9AM and 11AM.
You need to create a "HistoricalDataRequest" request:
You can then specify the start date and end date:
In your case, startdate and enddate will be 27-Aug for the first request, and 26-Aug for the second.
However, I'm not sure how you can override fields (
VWAP_START_TIME
andVWAP_END_TIME
) to restrict your VWAP to 9-11AM in a historical request, for reference data you would do smoething like the code below - it might work for historical requests too: