如何使用bloomberg API明确请求fx转发?
在Bloomberg终端,您可以选择是通过XDF获得FX Forwards作为绝对费率(outrights)还是作为Spots(Points)的抵消,达到7,然后选项大约是一半。 0表示直接,1表示平均值。
对于大多数默认值,您可以在API中明确设置它们,因此无论您运行哪台计算机,您的代码都会得到相同的结果。如何在V3 API查询中设置此项?
答案 0 :(得分:11)
在服务台告诉同事这是不可能的,事实证明他们错了,这是可能的。您将FWD_CURVE_QUOTE_FORMAT覆盖为绝对值和POINTS作为偏移量。
示例代码(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);
}
}
}
}