ManInMoon
ManInMoon

Reputation: 7005

How to override Bloomberg API RefData

I want to return more than the default amount of RefData for "BZCPI INDEX"

I know it is available because I can see it in Excel:

=BDH("BZCPI INDEX","PX_LAST","20110101","","cols=2;rows=101")

BUT I am unable to get earlier data, because I think START_DT is being ignored.

The below, give me a couple of years, but not from 2011 as I request:

    Globals.Masterform.iUpdateStatus("Connected sucessfully");
    Service refDataService = d_session.GetService("//blp/refdata");
    // create reference data request
    Request request = refDataService.CreateRequest("ReferenceDataRequest");
    // set request parameters
    Element securities = request.GetElement("securities");
    Element fields = request.GetElement("fields");
    Element requestOverrides = request.GetElement("overrides");
    request.Set("returnEids", true);


    Element overrides = request.GetElement("overrides");    
    Element ovr = overrides.AppendElement();
    ovr.SetElement(FIELD_ID, "START_DT");
    ovr.SetElement("value", "20110101");

What might I be doing wrong?

Upvotes: 1

Views: 1897

Answers (1)

Mourad Barakat
Mourad Barakat

Reputation: 671

Here are few more items further to the provided answers:

  1. Excel's =BDH() is implemented in the Api using HistoricalDataRequest to //blp/refdata service. If you have access to the Bloomberg terminal please type WAPI then click 'Translating Excel Formulas to API' link, the click 'BDH - Historical "End of Day" data'

  2. The code example in C# is HistoryExample.cs

  3. the endDate must be explicitly specified in the Api.

4.BZCPI INDEX ticks once a month, the last day of each month, so you need to specify a date range that includes one or more last days of the month(s), otherwise no data will return.

Upvotes: 1

Related Questions