Capital Markets Adapters 10.7 | Apama Capital Markets Adapters Documentation 10.7 | Bloomberg B-PIPE Adapter | Custom service | Sample
 
Sample
The reference data service \\blp\refdata is a request response schema based service offered by Bloomberg.
The list of available requests are as follows:
*ReferenceDataRequest
*HistoricalDataRequest
*IntradayTickRequest
*IntradayBarRequest
*BeqsRequest
*IntradayBarDateTimeChoiceRequest
1. ReferenceDataRequest
Control parameters
Values and description
REQ_TYPE
ReferenceDataRequest
Fields
Comma separated list of fields. Fields can be specified using the fields parameter or through MODELS. See Configurability.
overrides
A string format sequence of com.apama.bpipe.reqbasedservice.Overrides events.
Example on set parameter of reference request:
com.apama.session.CtrlParams params := new com.apama.session.CtrlParams;
sequence<com.apama.bpipe.reqbasedservice.Overrides>
overrideList := new sequence<com.apama.bpipe.reqbasedservice.Overrides>;

com.apama.bpipe.reqbasedservice.Overrides
overrides := new com.apama.bpipe.reqbasedservice.Overrides;
overrides.fieldId:="PX_BID";
overrides.value := "13";

overrideList.append(overrides);

com.apama.bpipe.reqbasedservice.overrides
overrides2 := new com.apama.bpipe.reqbasedservice.overrides;
overrides2.fieldId:="PRICING_SOURCE";
overrides2.value := "CG";
overrideList.append(overrides2);

params.addParam("overrides",OverrideList.toString());
params.addParam("YELLOW_KEY","Corp")
params.addParam("REQ_TYPE","ReferenceDataRequest")
params.addParam("Fields","PX_LAST,BID,ASK")
2. HistoricalDataRequest
Control parameters
Values and description
REQ_TYPE
HistoricalDataRequest
Fields
Comma separated list of fields. Fields can be specified using the fields parameter or through MODELS. See Configurability.
startDate
The start date in a year/month/day format. For example: 20180418.
endDate
The end date in a year/month/day format. This will default to the current day if not specified.
calendarOverridesInfo
A string format sequence of com.apama.bpipe.reqbasedservice.CalendarOverridesInfo events. Consists of two fields: calendarOverrides and calendarOverridesOperation
For more optional fields, look into BPIPE Developers Guide.
Examples
Keys
Values
Fields
BID, ASK
startDate
20150401
endDate
20150403
Adding the above fields to control parameters:
sequence<com.apama.bpipe.reqbasedservice.CalendarOverridesInfo>
CalendarOverridesList :=
new sequence<com.apama.bpipe.reqbasedservice.CalendarOverridesInfo>;

com.apama.bpipe.reqbasedservice.CalendarOverridesInfo
coInfo := new com.apama.bpipe.reqbasedservice.CalendarOverridesInfo;
coInfo.calendarOverrides := "UN,JN";
coInfo.calendarOverridesOperation:="CDR_AND";

CalendarOverridesList.append(coInfo);

params.addParam("calendarOverridesInfo",CalendarOverridesList.toString());
HistoricalDataResponse. The response will be an HistoricalDataResponse event.
3. IntradayTickRequest
Control parameters
Value and description
REQ_TYPE
IntradayTickRequest
Fields
Comma separated list of fields. Fields can be specified using the fields parameter or through MODELS. See Configurability.
startDateTime
The start date and time.
endDateTime
The end date and time.
eventTypes
Can be one of the TRADE, BID, ASK, BID_BEST, ASK_BEST, MID_PRICE, AT_TRADE, BEST_BID, BEST_ASK
Examples
Keys
Values
Fields
BID, ASK
startDateTime
2010-04-27T15:55:00
endDateTime
2010-04-27T16:00:00
The response will be an IntradayTickResponse event.
4. IntradayBarRequest
Control parameters
Value and description
REQ_TYPE
IntradayBarRequest
Fields
Comma separated list of fields. Fields can be specified using the fields parameter or through MODELS. See Configurability.
startDateTime
The start date and time.
endDateTime
The end date and time.
eventTypes
Can be one of the TRADE, BID, ASK, BID_BEST, ASK_BEST, MID_PRICE, AT_TRADE, BEST_BID, BEST_ASK
Examples
Keys
Values
Fields
BID, ASK
startDateTime
2010-04-27T15:55:00
endDateTime
2010-04-27T16:00:00
The response will be an IntradayBarResponse event.
5. BeqsRequest
Control parameters
Value and description
REQ_TYPE
BeqsRequest
screenName
The name of the screen to execute. It can be a user defined EQS screen or one of the Bloomberg Example screens on EQS <GO> on the BPS
screenType
Use PRIVATE for user-defined EQS screen.
Use GLOBAL for Bloomberg EQS screen.
Examples
Keys
Values
screenName
Vehicle-Engine-Parts
screenType
GLOBAL
languageId
GERMAN
com.apama.session.CtrlParams
ctrlParams := new com.apama.session.CtrlParams;
ctrlParams.addParam("screenName","Vehicle-Engine-Parts");
ctrlParams.addParam("screenType","Global");
ctrlParams.addParam("languageId","GERMAN");
Response will be a BeqsResponse event.
6. IntradayBarDateTimeChoiceRequest
Control parameters
Value and description
REQ_TYPE
IntradayBarDateTimeChoiceRequest
eventTypes
Can be one of the TRADE, BID, ASK.
security
Security to subscribe to.
interval
Interval for each update.
dateTimeInfo
Choice of setting start and end datetime or list start datetimes and duration. Can have the value of dateTimeRange or startDateDuration.
dateTimeRange requires the following control parameters:
*startDateTime. Start time of interval.
*endDateTime. End time of interval.
startDateDuration. Provides an array of start datetime and duration for every day. Requires the following control parameter:
*rangeStartDateTimeList. List of comma separated string of data and times.
Note:
All timelist should be of the format YYYY-MM-DDTHH:MM:SS. For example, 2018-04-08T15:55:00 for the above request.
*duration. Time required to receive the data.
The response will be an IntradayBarResponse event.