3

我在使用 Open API(.Net 平台)功能向 Bloomberg 请求时遇到了一些问题。我只是将excel函数转换为应用程序。请在下面查看我的代码。

现有的excel请求

=BDP(A6,col1:val1,col2:val2)

? 如何发送上述请求?

=BDP($A7, CORR_COEF, BETA_RAW_OVERRIDABLE, CIU Equity, CORR_COEF: BETA_OVERRIDE_START_DT,Date1:Date2,"BETA_OVERRIDE_PERIOD=d")

? 如何发送上述请求?

=BDS(B1,"TOP_MUTUAL_FUND_HOLDINGS","EndCol=2","StartCol=2","cols=1;rows=10")

    Request request = clsConnection.stRefDataService.CreateRequest("ReferenceDataRequest");
    Element securities = request.GetElement("securities");
    Element fields = request.GetElement("fields");
    securities.AppendValue("AAA Equity");
    fields.AppendValue("TOP_MUTUAL_FUND_HOLDINGS");
    AddOverride(request, "EndCol", "2");
    AddOverride(request, "StartCol", "2");
    AddOverride(request, "cols", "1");
    AddOverride(request, "rows", "10");

你能帮我纠正上面代码中的错误吗?


=BDH(A9,"CORR_COEF",columnA ,columnB ,"BETA_CALC_INTERVAL_OVERRIDE=1y","BETA_OVERRIDE_PERIOD=d","DTS=h","BETA_OVERRIDE_REL_INDEX=AA 指数")

    Request request = clsConnection.stRefDataService.CreateRequest("ReferenceDataRequest");
    Element securities = request.GetElement("securities");
    Element fields = request.GetElement("fields");
    securities.AppendValue("AAA Equity");
    fields.AppendValue("CORR_COEF");
    AddOverride(request,"BETA_CALC_INTERVAL_OVERRIDE", "1y");
    AddOverride(request, "BETA_OVERRIDE_PERIOD", "d");
    AddOverride(request, "DTS", "h");
    AddOverride(request, "BETA_OVERRIDE_REL_INDEX", "AAIndex");


    private void AddOverride(Request request, string fieldId, string fieldValue)
    {
        var override1 = request["overrides"].AppendElement();
        override1.SetElement("fieldId", fieldId);
        override1.SetElement("value", fieldValue);
    }

你能帮我纠正上面代码中的错误吗?

4

0 回答 0