Bloomberg API - using .Net API to get the FUT_CHAIN on an underlying security

非 Y 不嫁゛ 提交于 2020-01-03 03:14:08

问题


I am trying to query the Bloomberg API (.Net) to get the future chain on an underlying security. Preferably, I would be able to get the list of futures for a given date in the past.

The equivalent operation in Excel using the worksheet formula API would be the following:-

=BDS("ERA COMDTY","FUT_CHAIN","CHAIN_DATE=20120103",
    "INCLUDE_EXPIRED_CONTRACTS=Yes")

I looked at a large number of online resources, and I don't seem to be getting anywhere.


回答1:


For the v3 API, you need to use request overrides.

Request request = refDataService.createRequest("ReferenceDataRequest");

request.append("securities", "ERA Comdty");

request.append("fields","FUT_CHAIN");

Element overrides = request.getElement("overrides");
Element override1 = overrides.appendElement();
override1.setElement("fieldId", "CHAIN_DATE");
override1.setElement("value", "20120103");
Element override2 = overrides.appendElement();
override2.setElement("fieldId", "INCLUDE_EXPIRED_CONTRACTS);
verride2.setElement("value", 'Y');

session.sendRequest(request);


来源:https://stackoverflow.com/questions/12584483/bloomberg-api-using-net-api-to-get-the-fut-chain-on-an-underlying-security

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