In Bloomberg API how do you specify to get FX forw

2019-02-13 08:09发布

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?

标签: bloomberg
1条回答
姐就是有狂的资本
2楼-- · 2019-02-13 08:39

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);
      }
    }
  }
}
查看更多
登录 后发表回答