Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Bloomberg API how do you specify to get FX forwards as a spread rather than absolute values?

Tags:

bloomberg

How do you explicitly request fx forwards as outrights using the bloomberg API?

In the Bloomberg terminal you can choose whether to get FX Forwards as absolute rates (outrights) or as offsets from Spots (Points) by doing XDF, hitting 7, then the option is about half way down. 0 means outrights, and 1 means offfsets.

With most defaults you can explicitly set them in the API, so your code gives the same result whichever computer you run on. How do you set this one in a V3 API query?

like image 288
Nick Fortescue Avatar asked May 28 '10 13:05

Nick Fortescue


1 Answers

Having had a colleague told by the help desk this is impossible, it turns out they are wrong and it is possible. You override the FWD_CURVE_QUOTE_FORMAT to be RATES for absolute and POINTS as offsets.

Example code (Java):

public static void main(String [] args) throws Exception{
  Session session = BlpUtil.connectToReferenceData();
  Service refDataService = session.getService("//blp/refdata");
  Request request = refDataService.createRequest("HistoricalDataRequest");

  Element securities = request.getElement("securities");
  securities.appendValue("JPY10Y CMPL Curncy");

  Element fields = request.getElement("fields");
  fields.appendValue("PX_LAST");

  request.set("startDate", "20100527");
  request.set("endDate", "20100527");

  Element overrides = request.getElement("overrides");
  Element override1 = overrides.appendElement();
  override1.setElement("fieldId", "FWD_CURVE_QUOTE_FORMAT");
  override1.setElement("value", "POINTS");

  CorrelationID cid = session.sendRequest(request, null);
  while (true) {
    Event event = session.nextEvent();
    MessageIterator msgIter = event.messageIterator();
    while (msgIter.hasNext()) {
      Message msg = msgIter.next();
      if (msg.correlationID() == cid) {
        System.out.println("msg = " + msg);
      }
    }
  }
}
like image 127
Nick Fortescue Avatar answered Oct 05 '22 07:10

Nick Fortescue