Bloomberg API Open Source Development and Solution Providers India
-
Upload
point-perfect-technology-solutions -
Category
Technology
-
view
2.623 -
download
3
Transcript of Bloomberg API Open Source Development and Solution Providers India
Bloomberg API POINT PERFECT TECHNOLOGY SOLUTIONS
WWW.PPTSSOLUTIONS.COM
Overview of the Bloomberg API
The Bloomberg API provides developers with 24x7 programmatic access to data from the Bloomberg Data Centre for use in customer applications.
The established service provides free, unrestricted access to raw data for customers for its financial market information.
The Bloomberg API lets you integrate streaming real-time and delayed data, reference data, historical data, intraday data, and Bloomberg derived data into your own custom and third-party applications.
What kind of data?
Infrastructure for high-performance worldwide delivery of arbitrary structured data from multiple distributed sources
Many different services, with "market data" most heavily used Prices, trades, volumes, etc. delivered directly from exchanges Real-time subscriptions to live data Query interface to database of historical data
Features of the Bloomberg API
Interfaces in C, C++, Java, .NET, Perl, and Python Linux, Windows, Solaris, Mac OS X Full set of example applications—easy starting point
http://openbloomberg.com/open-api/ Lightweight Interfaces 32- and 64-bit Programming Support Pure Java Implementation: The Java API is implemented entirely in Java.
Bloomberg did not use JNI to wrap either our existing C library or the new C++ library.
Real-time prices in Pythonsession = blpapi.Session()session.start()subscriptions = blpapi.SubscriptionList()subscriptions.add("IBM US Equity", "LAST_PRICE,BID,ASK", "", blpapi::CorrelationId(1))session.subscribe(subscriptions)while (True):
event = session.nextEvent()for msg in event:print("IBM: ", msg)
Application Structure
The Bloomberg API object model contains a small number of key objects which applications use to request, receive and interpret data.
Session: An application creates a Session object to manage its connection with the Bloomberg infrastructure.
Service: Using the Session object, an application creates a Service object and then ‘opens’ each Bloomberg service that it will use.
Request: The client can make individual requests for data. Subscription: the client can start a subscription with the service for on-going
data updates. Event: Programmatically, the customer application obtains Event objects for the
Session and then extracts from those Event objects one or more Message objects containing the Bloomberg data.
Bloomberg API - Two Paradigms
Using the Request/Response Paradigm - 1
public static void main(String[] args) throws Exception {SessionOptions sessionOptions = new SessionOptions();sessionOptions.setServerHost("localhost"); // default valuesessionOptions.setServerPort(8194); // default valueSession session = new Session(sessionOptions);if (!session.start()) {
System.out.println("Could not start session.");System.exit(1);
}if (!session.openService("//blp/refdata")) {
System.out.println("Could not open service " +"//blp/refdata");System.exit(1);
}
Using the Request/Response Paradigm - 2
CorrelationID requestID = new CorrelationID(1);Service refDataSvc = session.getService("//blp/refdata");Request request =refDataSvc.createRequest("ReferenceDataRequest");request.append("securities", "IBM US Equity");request.append("fields", "PX_LAST");session.sendRequest(request, requestID);boolean continueToLoop = true;
Using the Request/Response Paradigm - 3
while (continueToLoop) {Event event = session.nextEvent();switch (event.eventType().intValue()) {
case Event.EventType.Constants.RESPONSE: // final eventcontinueToLoop = false; // fall throughcase Event.EventType.Constants.PARTIAL_RESPONSE:handleResponseEvent(event);break;default:handleOtherEvent(event);break;
}}}
Services
Core: Reference Data Service "//blp/refdata"Market Data Service "//blp/mktdata"
Additional: Custom VWAP Service "//blp/mktvwap"Market Bar Subscription Service "//blp/mktbar"API Field Information Service "//blp/apiflds"Page Data Service "//blp/pagedata"Technical Analysis Service "//blp/tasvc"API Authorization "//blp/apiauth"
Authorization and PermissioningSystems Authentication: Who is the consumer? Authorization: What data is the consumer entitled to see?
Publishing
The Bloomberg API allows customer applications to publish data as well as consume it. Customer data can be published for distribution within the customer’s enterprise, contributed to the Bloomberg infrastructure, distributed to others, or used for warehousing.
Publishing applications might simply broadcast data or they can be “interactive”, responding to feedback from the infrastructure about the currently active subscriptions from data consumers.
Simple Broadcast
Creating a session. Obtaining authorization. Creating the topic. Publishing events for the topic to the designated service.
Interactive Publication
Creating a session. Obtaining authorization. Registering for subscription start and stop messages. Handling subscription start and stop events, which add and remove topics to the
active publication set. Creating a topic. Publishing events for the active topics of the designated service.
Questions?