Overview
A high-level API that wraps existing Glue42 Bloomberg Bridge Market Data interop methods. The API is based on the jBloomberg open source wrapper.
Initialization
The JsBloomberg API depends on the Glue's Interop. It also accepts a config object to control logging behavior and optionally provide a custom logger implementation.
import JsBBG, { JsBloombergAPI } from "@glue42/bbg-market-data";
import Glue from "@glue42/desktop";
Glue().then(glue => {
const jsBBG: JsBloombergAPI = JsBBG(glue.interop, { debug: false });
});
Example (creating a HistoricalData request):
const requestArgs: HistoricalDataRequestArguments = {
securities: ["IBM US Equity", "MSFT US Equity"],
fields: ["LAST_PRICE"],
startDate: "20190101",
endDate: "20191231"
};
const request: HistoricalDataRequest = jsBBG.createHistoricalDataRequest(
requestArgs
);
request.onData(function handleResponse(
response: ResponseData<HistoricalData>
): void {
if (response.isLast) {
} else {
}
});
request.open();