我如何从彭博 API 获得交易假期 [英] How do I get trading holidays from the Bloomberg API

查看:58
本文介绍了我如何从彭博 API 获得交易假期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Bloomberg Java api 下载交易数据.我需要有人告诉我是否存在可以返回交易假期列表的函数.我翻阅了手册,但没有找到.如果没有这样的东西,有没有什么好的方法可以创建一个?谢谢.

I'm using Bloomberg Java api to download trading data. I need somebody to tell me if there exists a function which can return a list of trading holidays. I looked through the manual but couldn't find one. If there's no such a thing, is there a good way that I can create one? Thanks.

推荐答案

String field = "CALENDAR_HOLIDAYS";
//String field = "CALENDAR_NON_SETTLEMENT_DATES";
Request request = this._refDataServiceM.CreateRequest("ReferenceDataRequest");
Element securities = request.GetElement("securities");
securities.AppendValue("AAPL US Equity");
Element fields = request.GetElement("fields");
fields.AppendValue(field);

Element overridefields = request.GetElement("overrides");
Element overrides = request.GetElement("overrides");
Element override1 = overrides.AppendElement();
override1.SetElement("fieldId", "SETTLEMENT_CALENDAR_CODE");
override1.SetElement("value", calendar_code);
Element override2 = overrides.AppendElement();
override2.SetElement("fieldId", "CALENDAR_START_DATE");
override2.SetElement("value", startDate.ToString("yyyyMMdd"));
Element override3 = overrides.AppendElement();
override3.SetElement("fieldId", "CALENDAR_END_DATE");
override3.SetElement("value", endDate.ToString("yyyyMMdd"));

这篇关于我如何从彭博 API 获得交易假期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆