bloomberg API - Field Search Request

这一生的挚爱 提交于 2019-12-08 07:48:49

问题


How to make use of “category” according to “A.3.4 Field Search Request” of developers guide? The Bloomberglp.Blpapi.dll is from blpapi_dotnet_3.4.8.1., development by C# .net.

I used the following code in order to get the information but it does not work.

        Service refDataSvc = session.GetService("//blp/refdata");
        Request request = refDataSvc.CreateRequest("ReferenceDataRequest");
        request.Append("securities", "/isin/CNE1000002Q2 HK"); 
        Element element = request.GetElement("include");
        element.SetElement("productType", "Equity");
        element.SetElement("fieldType", "Static");
        Element element1 = element.GetElement("category");
        element1.AppendValue("Ratings");
        element1.AppendValue("Analysis");
        element1.AppendValue("Corporate Actions");
        session.SendRequest(request, null);

I also tried other ways

a)

        Service refDataService = session.GetService("//blp/refdata");
        Request request = refDataService.CreateRequest("ReferenceDataRequest");
        Element securities = request.GetElement("securities");
        securities.AppendValue("IBM US Equity");
        Element fields = request.GetElement("fields");
        fields.AppendValue("PX_LAST");
        Element element1 = fields.GetElement("category");
        element1.AppendValue("Corporate Actions");
        session.SendRequest(request, null);

b)

        Service refDataService = session.GetService("//blp/refdata");
        Request request = refDataService.CreateRequest("ReferenceDataRequest");
        Element securities = request.GetElement("securities");
        securities.AppendValue("IBM US Equity");
        Element element1 = request.GetElement("category");
        element1.AppendValue("Corporate Actions");
        session.SendRequest(request, null);

Both are not successful. Could anyone advise me on this?

来源:https://stackoverflow.com/questions/11899919/bloomberg-api-field-search-request

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