Retrieving BB Factor History data with jbloomberg

118 views Asked by At

I am using com.assylias.jbloomberg package and have managed to get the example code to run. I currently use the BB API's on an Excel spreadsheet. The formula I have is

=BDS({isin-code},"FACTOR_SCHEDULE","cols=2;rows=3")

This returns data as per the BB function DES {isin-code}/BB page 20 Schedules/BB page 56 Factor History. That is: Date and Factor%, repeated many times.

My question is: how would I code this using the com.assylias.jbloomberg? I assume I would need to create an instance of a RequestBuilder object. What parameters would I pass in? Thanks in advance. Any help or pointers to PDF documentation much appreciated. Colin

1

There are 1 answers

1
assylias On

For bulk fields, you need to use a ReferenceRequestBuilder - it would look like this:

BloombergSession bb = new DefaultBloombergSession();
try {
  bb.start();
  String isin = "/isin/XS0889937305";
  String field = "FACTOR_SCHEDULE";
  ReferenceData data = bb.submit(new ReferenceRequestBuilder(isin, field)).get();
  List<Map<String, TypedObject>> asList = (List<Map<String, TypedObject>>) data.forField(field).forSecurity(isin).get();
  asList.forEach(System.out::println);
} finally {
  bb.stop();
}