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

前端 未结 1 767
感动是毒
感动是毒 2021-01-05 07:26

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

相关标签:
1条回答
  • 2021-01-05 08:12

    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);
          }
        }
      }
    }
    
    0 讨论(0)
提交回复
热议问题