Giter VIP home page Giter VIP logo

jbloomberg's People

Contributors

assylias avatar dm3 avatar jonfreedman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jbloomberg's Issues

If the session can't be started, submit hangs forever

If the session can't be open, submit hangs forever instead of throwing an exception.

Typical log output:

2013-09-23 19:29:36,742 INFO [AWT-EventQueue-0] [BloombergUtils.java:107] bbcomm.exe is started
2013-09-23 19:29:36,744 INFO [AWT-EventQueue-0] [DefaultBloombergSession.java:106] Starting Bloomberg session #1 with options: {AllowMultipleCorrelatorsPerMsg=false, AutoRestartOnDisconnection=false, ClientMode=AUTO, ConnectTimeout=5000, DefaultKeepAliveInactivityTime=20000, DefaultKeepAliveResponseTimeout=5000, DefaultServices=[Ljava.lang.String;@79402611, DefaultSubscriptionService=//blp/mktdata, DefaultTopicPrefix=ticker/, MaxEventQueueSize=10000, MaxOutstandingRequests=128, MaxPendingRequests=1024, MaxSendCacheSize=134217728, ServerAddresses=[Lcom.bloomberglp.blpapi.SessionOptions$ServerAddress;@d0012ae, ServerHost=127.0.0.1, ServerPort=8194, SlowConsumerWarningHiWaterMark=0.75, SlowConsumerWarningLoWaterMark=0.5}
2013-09-23 19:29:36,755 INFO [AWT-EventQueue-0] [DefaultBloombergSession.java:117] Session #1 started asynchronously
2013-09-23 19:29:36,793 DEBUG [Thread-4] [BloombergEventHandler.java:46] [SESSION_STATUS] SessionConnectionUp = {
    server = "/127.0.0.1:8194"
}

2013-09-23 19:29:44,812 DEBUG [SwingWorker-pool-1-thread-1] [BloombergCharts.java:156] Retrieving security name for SX5E Index
2013-09-23 19:29:44,813 DEBUG [SwingWorker-pool-1-thread-1] [DefaultBloombergSession.java:174] Submitting request com.assylias.jbloomberg.ReferenceRequestBuilder@7692d86e
2013-09-23 19:29:44,815 DEBUG [Bloomberg Session # 1 - 1] [DefaultBloombergSession.java:225] Waiting for session to start while opening service REFERENCE_DATA
2013-09-23 19:30:36,812 DEBUG [Thread-4] [BloombergEventHandler.java:46] [SESSION_STATUS] SessionStartupFailure = {
    reason = {
    }
}

PackageInfoTest issue

Hi Yann,

test_IntradayTickExample => Doesn't work during Asian hours
Example fix: Replace "now.minusHours(2)" by "now.minusHours(23)"

Thanks

Process ADMIN events in BloombergEventHandler and log appropriately

In order to ensure that your application is processing event messages fast enough and not losing data, you will want to handle all "ADMIN" event messages. We demonstrate how to handle this event type in the "SubscriptionWithEventHandlerExample" SDK example.

If your application is not reading/processing the incoming events fast enough, the internal queue of the API library will begin queuing up all event messages. When this occurs, you will receive an event of EventType ADMIN containing a message of type SlowConsumerWarning. This message will be sent once the number of undelivered events sent to the user(s) reaches the high percentage threshold set with the SessionOptions.SlowConsumerWarningHiWaterMark property (default: 0.75). This percentage is based on the maximum event queue size, which is set with the SessionOptions.MaxEventQueueSize property (default: 10000). At this point, no data has been lost, but you are in danger of doing so if appropriate action isn't taken. Ideally, this action would be to optimize your processing of event messages or reducing your data requests/subscriptions. but you could also try increasing the maximum event size by setting the MaxEventQueueSize property value.

If you receive a SlowConsumerWarningCleared message, then you have dropped below the low percentage threshold, which is set using the SessionOptions.SlowConsumerWarningLoWaterMark (default: 0.5).

If the number of events outstanding for delivery exceeds the specified threshold controlled by SessionOptions.MaxEventQueueSize, then the Bloomberg communication server (i.e. bbcomm, serverapi, etc.) will begin dropping events, as the API library's internal queue will be full and no longer able to receive any further messages until the situation is addressed. This will be indicated by a "DataLoss" message contained in an ADMIN event.

Within this message, you will find an "id", "source" and "numMessagesDropped" property value. The "id" property identifies the affected subscription, while the "source" will have a value of "InProc", which means that it occurred within your application (currently, this is the only possible source). The final property is "numMessagesDropped", which indicates the total number of messages dropped at the time the dataloss message was received for that particular subscription. It is important to note that the subscription, identified by "id", will not be automatically canceled by the API library.

IMPORTANT NOTES:

The above information only applies to API library versions 3.5.2.1, and greater. If you are using earlier versions of the API libraries, it is advised that you upgrade in order to ensure you are using the latest supported versions and taking advantage of new features and bug fixes. In earlier C++ API library versions, for example, you will not receive any DataLoss or SlowConsumerWarning/SlowConsumerWarningCleared Admin event messages, while for earlier Java and .NET API libraries, only SlowConsumerWarning/SlowConsumerWarningCleared Admin messages will be returned, but no DataLoss Admin messages.

Problem with bulk data: Cannot convert SEQUENCE to String

When retrieving bulk data an exception is thrown:

Caused by: com.bloomberglp.blpapi.InvalidConversionException: Cannot convert SEQUENCE to String
at com.bloomberglp.blpapi.impl.cU.ax(ElementImpl.java:408)
at com.bloomberglp.blpapi.impl.cU.getValueAsString(ElementImpl.java:360)
at com.bloomberglp.blpapi.impl.cU.getValueAsString(ElementImpl.java:352)
at assylias.jbloomberg.BloombergUtils.getSpecificObjectOf(BloombergUtils.java:61)

Test:

RequestBuilder request = new ReferenceRequestBuilder("IBM US Equity", "TOP_20_HOLDERS_PUBLIC_FILINGS");
session.submit(request);

How to import the project into Eclipse

Hi assylias,

I downloaded your project from here, and I'm trying to import it to Eclipse as a Java project. However, Eclipse says that "No projects are found to import." Can you please help me out?

Thank you so much in advance!

Issue on date formating (appears few days ago)

Hi Assylias
First of all, thanks for you work I use your library every day since few years and it was very helpful for my work.
I think Bloomberg made an update on the time zone in the date format and this create a runtime time exception on line 35 of com.assylias.jbloomberg.HistoricalResultParser.
May I suggest you a modification like
final LocalDate date = parseLocalDate(firstField.getValueAsString().substring(0,10));
instead of
final LocalDate date = parseLocalDate(firstField.getValueAsString());
If you think it is a bad idea no problem, I have rebuilt your lib with this correction and it’s work for me.
Thanks again for your work
Kinds regards
Alx

Subscribing twice to an expired security throws an exception

When subscribing twice to an expired security (e.g. VGZ14 Index), the following exception is thrown:

com.bloomberglp.blpapi.NotFoundException: CorrelationID: Internal: 3 not found

This is because the SubscriptionManager tries to resubscribe to the security but the initial subscription was declined.

Looking for information

Hi Assylias,

Fisrt of all thanks for your work,

I would like to use your library but i don't manage to get an example

My use case get is to get a response matrix (or guava table) with a list of ticker and a list of bloomberg field

Do you have an example to do this using you library?

Thanks a lot by advance

Kinds regard

oskar

PS: all is ok in my side about setup (bbg.jar and your library)

Latest version not in Maven repo

Hi,

Would it be possible to push the latest version into Maven repo? It looks like some features in source code are not available in 3.3 (custom session options).

Regards,
Lukasz

Problem Usage: java org.joda.time.tz.ZoneInfoCompiler

Hi assylias,

I m not a Java expert and a bit stuck. I like you library a lot but can not use it so far.
The error i get is:

Usage: java org.joda.time.tz.ZoneInfoCompiler
where possible options include:
-src Specify where to read source files
-dst Specify where to write generated files
-verbose Output verbosely (default false)

Do you have any suggestions?

Kind regards

Fons

EMSX Request Functionality

First off, great work on with your library! This is exactly what I had hoped to do!

I was wondering if you thought it would make sense to add EMSX functionality to this library, or whether you thought it was outside of the scope. I currently want to add these request types and didn't know if it made sense to merge it upstream.

/*
 * Copyright (C) 2012 - present by Yann Le Tallec.
 * Please see distribution for license.
 */
package com.assylias.jbloomberg;

/**
 * The names internally used by Bloomberg to identify the various types of requests - users don't need to use these
 * values directly.
 */
public enum BloombergRequestType {

    HISTORICAL_DATA("HistoricalDataRequest"),
    INTRADAY_TICK("IntradayTickRequest"),
    INTRADAY_BAR("IntradayBarRequest"),
    REFERENCE_DATA("ReferenceDataRequest"),
    PORTFOLIO_DATA("PortfolioDataRequest"),
    EXCELGETGRIDREQUEST_DATA("ExcelGetGridRequest"),
    INSTRUMENT_LIST("instrumentListRequest"),

    /**
     * EMSX Related Requests
     * @see <a href="https://emsx-api-doc.readthedocs.io/en/latest/programmable/description.html">https://emsx-api-doc.readthedocs.io/en/latest/programmable/description.html</a>
     */

    /**
     * Assign an order to another UUID.
     */
    ASSIGN_TRADER("AssignTrader"),
    /**
     * Cancel outstanding routes (placements).
     */
    CANCEL_ROUTE_EX("CancelRouteEx"),
    /**
     * Create an order or stage an order into EMSX<GO>.
     */
    CREATE_ORDER("CreateOrder"),
    /**
     * Create a new order and route in a single request.
     */
    CREATE_ORDER_AND_ROUTE_EX("CreateOrderAndRouteEx"),
    /**
     * Create the order and notify EMSX this is routed.
     */
    CREATE_ORDER_AND_ROUTE_MANUALLY("CreateOrderAndRouteManually"),
    /**
     * Delete an existing order in EMSX<GO>.
     */
    DELETE_ORDER("DeleteOrder"),
    /**
     * Get all field meta data in a response message.
     */
    GET_ALL_FIELD_META_DATA("GetAllFieldMetaData"),
    /**
     * Get all broker strategy information and asset class data.
     */
    GET_BROKER_STRATEGIES_WITH_ASSET_CLASS("GetBrokerStrategiesWithAssetClass"),
    /**
     * Get all broker strategy info and asset class data.
     */
    GET_BROKER_STRATEGY_INFO_WITH_ASSET_CLASS("GetBrokerStrategyInfoWithAssetClass"),
    /**
     * Get all broker data with asset class in a response message.
     */
    GET_BROKER_WITH_ASSET_CLASS("GetBrokerWithAssetClass"),
    /**
     * Get field meta data in a reponse message.
     */
    GET_FIELD_META_DATA("GetFieldMetaData"),
    /**
     * Get team data in a response message.
     */
    GET_TEAMS("GetTeams"),
    /**
     * Submit the entire list as a single route to a basket algorithm.
     */
    GROUP_ROUTE_EX("GroupRouteEx"),
    /**
     * Modify parent order.
     */
    MODIFY_ORDER("ModifyOrder"),
    /**
     * Modify child route.
     */
    MODIFY_ROUTE_EX("ModifyRouteEx"),
    /**
     * Route existing order.
     */
    ROUTE_EX("RouteEx"),
    /**
     * Route manually and notify EMSX that it is routed.
     */
    ROUTE_MANUALLY_EX("RouteManuallyEx");

    private final String requestName;

    BloombergRequestType(String requestName) {
        this.requestName = requestName;
    }

    /**
     * @return the type of request, for example "HistoricalDataRequest"
     */
    @Override
    public String toString() {
        return requestName;
    }
}

Support Market List Service (//blp/mktlist) requests

From section 5.9 of the Core Developer Guide:

The Market List Service (//blp/mktlist) is used to perform two types of list data operations. The first is to subscribe to of instruments, known as “chains,” using the “chain” (i.e., //blp/mktlist/chain). The second is to a list of all the instruments that match a given topic key using the “secids” (i.e., /mktlist/secids). The //blp/mktlist service is available to both BPS (Bloomberg Professional service) and NONBPS .

Need a way to check if a session is alive

Currently you can only check if a session is live by submitting a request and catching an exception.
It would be nice to be able to have a defined set of states that the session is going through and a way to register a callback on session startup which would get called with the state changes.

We could start with the two main states: Started and Stopped.

What do you think?

feature request: ability to retreview 'bsrch' queries.

I started jBloomberg for some bloomberg work and its been great. The one functionality that I dont think I was able to do was being able to run the bloomberg SRCH data queries. Here's an example in python on how it is implemented: It needs to use the ExcelGetGridRequest service functionality via the API unfortunately.

https://github.com/matthewgilbert/pdblp/blob/master/pdblp/pdblp.py

def bsrch(self, domain):
"""This function uses the Bloomberg API to retrieve 'bsrch'
(Bloomberg SRCH Data) queries. Returns list of tickers.
Parameters
----------
domain: string
A character string with the name of the domain to execute.
It can be a user defined SRCH screen, commodity screen or
one of the variety of Bloomberg examples. All domains are in the format
:<search_name>. Example "COMDTY:NGFLOW"
Returns
-------
data: pandas.DataFrame
List of bloomberg tickers from the BSRCH
"""
logger = _get_logger(self.debug)
request = self.exrService.createRequest("ExcelGetGridRequest")
request.set("Domain", domain)
self.session.sendRequest(request)
data = []
# Process received events
while True:
event = self.session.nextEvent(self.timeout)
if event.eventType() == blpapi.Event.RESPONSE or
event.eventType() == blpapi.Event.PARTIAL_RESPONSE:
for msg in event:
logger.info(msg)
for v in msg.getElement("DataRecords").values():
for f in v.getElement("DataFields").values():
data.append(f.getElementAsString("StringValue"))
if event.eventType() == blpapi.Event.RESPONSE:
break
return pd.DataFrame(data)

Add to RealtimeField

The following realtime fields are not currently available for subscription

  • EID
  • LAST_UPDATE_ASK_RT
  • LAST_UPDATE_BID_RT
  • PRICE_LAST_TIME_RT

DefaultBloombergSession doesn't allow customizing SessionOptions

Currently DefaultBloombergSession holds a static SessionOptions object which cannot be customized by the user. I guess that's why the implementation is called 'Default'. However, it seems strange that the only other option a user has is to create (or copy) a whole new implementation of the BloombergSession interface in order to set a different server port.

What is the reason behind this and would you accept adding another constructor to DefaultBloombergSession with an ability to override the SessionOptions?

Allow passing new RealtimeField as string

If a new realtime field is exposed by the Bloomberg API, it can't be access until the RealtimeField enum is updated.

Allow to pass a realtime field as a string to the SubscriptionBuilder.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.