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

余生颓废 提交于 2019-11-30 20:40:58

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);
      }
    }
  }
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!