Bloomberg C# API - 如何使用不同选项/字段调用 BDP
我正在尝试从 Excel 加载项迁移到 Bloomberg C# Desktop API。对于像 BDP("AB IB Equity","best_analyst_ rating") 这样的简单调用,我可以使用这样的方法而不会出现问题:
private void sendRefDataRequest(Session session)
{
Service refDataService = session.GetService("//blp/refdata");
Request request = refDataService.CreateRequest("ReferenceDataRequest");
// Add securities to request
Element securities = request.GetElement("securities");
securities.AppendValue("AB IB Equity");
Element fields = request.GetElement("fields");
fields.AppendValue("best_analyst_rating");
System.Console.WriteLine("Sending Request: " + request);
session.SendRequest(request, null);
}
但是对于涉及 BDP 附加选项的更复杂的调用,例如 BDP("AB IB Equity","bs_tot_asset","EQY_Consolidated","Y","EQY_FUND_Relative_Period","-0FY") 我不知道如何将其转换为 C# 调用。感谢对此的任何帮助。
I am trying to migrate from Excel add-in to Bloomberg C# Desktop API. For simple calls like BDP("AB IB Equity","best_analyst_rating") I am able to do without issues using something like this:
private void sendRefDataRequest(Session session)
{
Service refDataService = session.GetService("//blp/refdata");
Request request = refDataService.CreateRequest("ReferenceDataRequest");
// Add securities to request
Element securities = request.GetElement("securities");
securities.AppendValue("AB IB Equity");
Element fields = request.GetElement("fields");
fields.AppendValue("best_analyst_rating");
System.Console.WriteLine("Sending Request: " + request);
session.SendRequest(request, null);
}
But for more complex calls involving additional options to BDP like
BDP("AB IB Equity","bs_tot_asset","EQY_Consolidated","Y","EQY_FUND_Relative_Period","-0FY") I have no clue how to translate it to C# calls. Appreciate any help on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要设置覆盖。对于任何给定字段,您都可以使用 Bloomberg 终端中的 FLDS 找到这些字段。
然后循环执行必要的覆盖,将 fieldId 设置为 FLDS 中的助记符,并将值设置为您的特定请求:
You need to set the overrides. For any given field you can find these using FLDS in the Bloomberg terminal.
Then loop through the necessary overrides, setting the fieldId to the Mnemonic from FLDS and the value to your specific request:
我为此创建了一个扩展方法:
I created an extension method for this: