alpha-xone / xbbg

An intuitive Bloomberg API
https://xbbg.readthedocs.io/
Apache License 2.0
249 stars 52 forks source link

Null service handle error #10

Closed e-ercan closed 4 years ago

e-ercan commented 4 years ago

Hi, thanks for the package.

I'm sure it's my fault but I've tried everything I can think of but I'm unable to get it working.

I couldn't find anyone with the same issue or anything related to blpapi that helped

I've installed according to instruction, matched the versions of the C++ SDK (3.14.1xx) to the python version 3.14 and moved the blpapi ddls to the correct place

When I try to run the examples I think xbbg.blp isnt able to establish a connection properly

67BCF766-BED3-45B3-8E5C-1898052E9EAA

I tried manually using blpapi to establish a connection which appears to work (despite the error returned, session.start() returns true)

77FC4667-AC9B-458D-9CD3-89AE1E66B1C5

I tried looking through conn.py but wasn't able to resolve it myself

Interestingly the live function appears to work

9275B359-6D95-4564-A434-BBB0D282A17D

Not sure what to try next, I've tried reinstalling from scratch but no luck

Thank you for any help, much appreciated

alpha-xone commented 4 years ago

Which version are you using? I just tried below two (date of bdib is 2019 cause we can only get intraday data within half an year) and both work (you can add log='debug' to see what exactly have been sent to Bloomberg section):

image

In your manual connection code, can you try below to see what happens:

req = ref.createRequest('ReferenceDataRequest')

Looks like something is wrong ReferenceDataRequest.

e-ercan commented 4 years ago

Thanks for the quick reply

I'm using the latest version of xbbg installed via pip, same with blpapi, and the 3.14 major version of the Python and C++ SDK downloaded from WAPI on Bloomberg

This is the ReferenceDataRequest and the output which seems to have worked

1

The result it returns for PX_LAST is 7 so I think I'm managing to connect to the API and haven't messed up the install of blpapi (I think)

The next image is the error I get on the first attempt to execute the call

2

This image is the error I get every attempt afterwards

3

Thought that might be useful

Thanks

alpha-xone commented 4 years ago

Found the problem - there are some API changes of blpapi from 3.13.1 to 3.14.0. I was using 3.13.1 before.

You can download the C++ experimental API from Bloomberg website (currently still 3.13.x) and install 3.13.1 as temporary solution:

pip install blpapi==3.13.1 --index-url=https://bloomberg.bintray.com/pip/simple

Will update the package later - guess will take some time.

e-ercan commented 4 years ago

Thank you, I really appreciate it

alpha-xone commented 4 years ago

Easier than I thought. Now it should be ok.

Kindly update and check if it works. Thx

e-ercan commented 4 years ago

Working perfectly now, cheers :)