日历日期名称或说明是否有替代?

时间:2019-06-06 09:47:11

标签: c# bloomberg

我正在尝试使用Bloomberg API获取有关股票行情的假期信息,下面的请求会正确生成日期,但我也想添加假期的名称

是否存在一个替代项,其中还将包含日期名称(如“新年”)

ReferenceDataRequest = {
    securities[] = {
        LQ45 Index
    }
    fields[] = {
        CALENDAR_HOLIDAYS
    }
    overrides[] = {
        overrides = {
            fieldId = "SETTLEMENT_CALENDAR_CODE"
            value = "JA"
        }
        overrides = {
            fieldId = "CALENDAR_START_DATE"
            value = "20190101"
        }
        overrides = {
            fieldId = "CALENDAR_END_DATE"
            value = "20191231"
        }
    }
    tableOverrides[] = {
    }
}

我正在使用的C#代码是在另一个我找不到的问题上提出的,它是:

            Request request = this._service.CreateRequest("ReferenceDataRequest");
            Element securities = request.GetElement(BloombergConstants.SECURITIES);
            securities.AppendValue(ticker);
            Element fields = request.GetElement(BloombergConstants.FIELDS);
            fields.AppendValue("CALENDAR_HOLIDAYS");

            //Element overridefields = request.GetElement(BloombergConstants.OVERRIDES);
            Element overrides = request.GetElement(BloombergConstants.OVERRIDES);
            Element override1 = overrides.AppendElement();
            override1.SetElement(BloombergConstants.FIELDID, "SETTLEMENT_CALENDAR_CODE");
            override1.SetElement(BloombergConstants.VALUE, calendarCode);
            override1 = overrides.AppendElement();
            override1.SetElement(BloombergConstants.FIELDID , "CALENDAR_START_DATE");
            override1.SetElement(BloombergConstants.VALUE, startDate.ToString("yyyyMMdd"));
            Element override2 = overrides.AppendElement();
            override2.SetElement(BloombergConstants.FIELDID, "CALENDAR_END_DATE");
            override2.SetElement(BloombergConstants.VALUE, endDate.ToString("yyyyMMdd"));

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

不幸的是,似乎没有重写代码可以添加此行为。这有点不直观,但是如果您搜索相关的代码CALENDAR_HOLIDAYS,您实际上会收到有关代码CALENDAR_NON_SETTLEMENT_DATES的信息(可能在某些时候它已被重命名并使用别名?)

fieldInfoRequest = {
        id[] = {
            "CALENDAR_HOLIDAYS"
        }
    }

fieldResponse = {
        fieldData[] = {
            fieldData = {
                id = "ZS090"
                fieldInfo = {
                    mnemonic = "CALENDAR_NON_SETTLEMENT_DATES"
                    description = "Calendar Non-Settlement Dates"
                    datatype = String
                    categoryName[] = {
                    }
                    property[] = {
                    }
                    overrides[] = {
                        "ZS089", "ZS087", "ZS088"
                    }
                    ftype = BulkFormat
                }
            }
        }
    }

这些替代对应于

   id                  mnemonic
ZS087  SETTLEMENT_CALENDAR_CODE
ZS088       CALENDAR_START_DATE
ZS089         CALENDAR_END_DATE

没有一个功能可返回日期对应的假期的描述。