Using the Bloomberg open API. How can I get the PX_LAST value at a specific date and time?
I am able to get the last trade of a specific day (effectively, the close price) using:
Request request = refDataService.createRequest(historicalData);
request.getElement("securities").appendValue("IBM US Equity");
request.getElement("fields").appendValue("PX_LAST");
String date = "20120801";
request.set("startDate", date);
request.set("endDate", date);
Now I need to know the PX_LAST at a specific date and time. For instance, what was the prevailing trade price at 9:45 on Aug 1?
One way is to create an
IntradayBarRequestrequest with the following parameters:with
startDate = "2012-08-01T09:45:00"Note that in my timezone I don’t get anything for 9:45 but I do get something for 15:45 (cf your previous question).
If you use Joda’s DateTime, you can use the following pattern: