Isn't BEmu already Scripting interface ready?

Mar 5, 2014 at 5:08 PM
A basic issue is not clear to me:
If BEmu_cpp.dll is a replacement to say blpapi3_63.dll, why should I have any problem using it "out-of-the-box" from whatever API implementation found in Bloomberg's Open API page, be it Perl, Python or whatever?
Regards
Meir
Coordinator
Mar 5, 2014 at 5:35 PM
MeirG,

I don't quite understand your question. The C++ version of BEmu (BEmu_cpp.dll) is meant to work the same as the C++ version of the actual BB API (blpapi3_XX.dll). If you write C++ code that interacts with BEmu, it will also work with the BB API.

Are you asking if you can call BEmu_cpp.dll code from a Perl or Python script? I'm unfamiliar with both Perl and Python, so I don't know. My search for calling C++ code from Perl returned this that may help. A similar search for Python returned this.

Does this help? Again, I have almost no experience with either Perl or Python, so I won't be much help here.

Thank you for your interest in my project.

-Robinson664
Mar 5, 2014 at 8:17 PM
Dear Robinson664,

Well, the dear folks at the Bloomberg Open API group already did the whole interface which is there, on their API page. They even provided a few examples. Here is the list. Please have a guess as to which one should I attempt first (and/or which should I avoid) since you know what your emulation does and does not. Here goes:
  • LocalSubscriptionExample.pl
  • MktdataBroadcastPublisherExample.pl
  • PagePublisherWithPermissioning.pl
  • RefDataExample.pl
  • SimpleSubscriptionExample.pl
I will start with the one you suggest and see if I can make it work.
Regards,
Meir
Mar 5, 2014 at 8:42 PM
My suggestion is that the RefDataExample.pl is probably the most straight forward so maybe consider starting there. I have been working on very simple C++ and C# examples and was going to work on Python next.
Mar 5, 2014 at 9:27 PM
Thank you rholowczak!
I am out of town in the following couple of days, but I'll report ASAP.
Meir
Mar 8, 2014 at 12:43 PM
Edited Mar 8, 2014 at 1:28 PM
I encountered the following problems:
  • My box as well as my blpapi3_64.dll is a 64 bit one. All BEmu*.dll are 32 bit, right? Their blpapi3_32.dll, cannot be used on a 64 bit OS.
  • The BLPAPI Perl library shields (read "isolates") me from the dll.
You must realize that although I am programing, I am by no means a programmer. I never implemented even a single C++ program and I (probably) don't have the tool chain for doing it apart from what was installed as part of the Strawberry Perl installation. So, to take your source code and the C/C++ part of the BLP Open API Perl library and to make it into a BEmu Perl library is not something that will work for me.

My conclusion therefore is that a Perl project must end up not only with emulating the Bloomberg terminal but also with emulating part or all of the 25 Perl library packages.

As i am sure you are well aware, the BLPAPI is an Open Source project and the code itself can be found on github. So this is doable in principle, but I am not qualified to do it.

BTW, the BLPAPI folks themselves are interested in a terminal emulation. They might be willing to foot the bill for that. Your call...
Coordinator
Mar 8, 2014 at 7:42 PM
MeirG,

Can I ask what it is you're trying to do? What are you trying to do with the Bloomberg API? What is your experience with Perl if you're not a programmer? If I knew what your ultimate goal was, I might be able to help you out more, if it's within the scope of what the BEmu is meant to do.

Concerning your questions:

1) The C# BEmu version targets both x86 and x64 CPUs. The Java version should work no matter what. I have to check if there's an easy way to make the C++ version target both kinds of CPUs. Considering that the BB API available at http://www.openbloomberg.com/open-api/ seems to target both, it should be possible. I'll look in to that.

2) "The BLPAPI Perl library shields (read "isolates") me from the dll." I don't know what this means. Again I have no experience with Perl, so I am no help with this issue. My favorite site for help with any programming questions is here http://stackoverflow.com/.

3) Emulating the BB Terminal. To be sure, are you talking about emulating one of these? That's completely out of the scope of my project. I don't have anywhere near the resources required to emulate a BB Terminal. I'm only working with the BB API.

4) "Open Source". This project that you linked is a set of standard library functions for C++ (not Perl). It looks like it's meant to provide the same functionality as http://en.wikipedia.org/wiki/Standard_Template_Library or http://en.wikipedia.org/wiki/Boost_C%2B%2B_Libraries. It is not related to the Bloomberg API.

5) "BTW, the BLPAPI folks themselves are interested in a terminal emulation. They might be willing to foot the bill for that. Your call..." I don't know what you mean by this.

Again, if you can tell me what your ultimate goal is, I might be able to help you. Remember that I have no experience with Perl.

-Robinson664
Mar 8, 2014 at 9:17 PM
Robinson664 wrote:
MeirG,

Can I ask what it is you're trying to do? What are you trying to do with the Bloomberg API?
I am part of a small group with an idea about some algo-trading algorithms that we would like to explore. We are not financed yet so we try to be frugal. We have a friendly organization that might allow us to download historical data. What we plan to do is to download a batch, populate a DB, and simulate the algorithm's performance. However we cannot impose ourselves too much and we certainly cannot sit there and develop even the hookup of our download scripts to the BB servers.

So we plan to develop on our premises, vis-a-vis a BB emulation of a server and to do at that friendly site only the final integration.
What is your experience with Perl if you're not a programmer? If I knew what your ultimate goal was, I might be able to help you out more, if it's within the scope of what the BEmu is meant to do.
I program Perl on a daily basis for about five years. I am an EE MSc. by training and did program in many languages all my career. Unfortunately none of it in either C or C++ :-(
Concerning your questions:

1) The C# BEmu version targets both x86 and x64 CPUs. The Java version should work no matter what. I have to check if there's an easy way to make the C++ version target both kinds of CPUs. Considering that the BB API available at http://www.openbloomberg.com/open-api/ seems to target both, it should be possible. I'll look in to that.
Please note that there are both 32 bit and 64 bit versions of the Python interface to be downloaded from BB Open-API page.

And please read first my comments to your #2 answer...

My assumption is that as long as BEmu is named the same and found at the same path, (which is not the current case with BEmu right now) has the same services and complies with BB's Open-API, the Perl interface modules provided by BB will work the same and my scripts that only call these modules will work fine.
2) "The BLPAPI Perl library shields (read "isolates") me from the dll." I don't know what this means. Again I have no experience with Perl, so I am no help with this issue.
The "engine" that connects to the BB servers, is the blpapi3_64.dll. It must be in the Windows\System32 and Windows\SysWOW64\ directories. It was called by the installation's unit-tests. There is another one, called internal.dll, and it was placed in the Strawberry Perl installation by the BLPAPI installation. I couldn't fine how the Perl library, which is a pure-Perl, calls services from these two. That what I meant by "shielding me". Again, I never wrote a Perl C/C++ extension.
My favorite site for help with any programming questions is here http://stackoverflow.com/.
Yes, but they are very mean to non-programmers like me. I rarely, if ever got a meaningful answer to my questions. I do use it though to find answers given to other folks.
3) Emulating the BB Terminal. To be sure, are you talking about emulating one of these? That's completely out of the scope of my project. I don't have anywhere near the resources required to emulate a BB Terminal. I'm only working with the BB API.
Oh God NO! Please see above...
4) "Open Source". This project that you linked is a set of standard library functions for C++ (not Perl). It looks like it's meant to provide the same functionality as http://en.wikipedia.org/wiki/Standard_Template_Library or http://en.wikipedia.org/wiki/Boost_C%2B%2B_Libraries. It is not related to the Bloomberg API.
Hmmm! I am sure Perl libraries are lurking there, but in any case, Perl is "open" by definition and you can find it on the Open-API page. I would assume that the C/C++ SDK on that page is also on github, don't they?
5) "BTW, the BLPAPI folks themselves are interested in a terminal emulation. They might be willing to foot the bill for that. Your call..." I don't know what you mean by this.
I am quoting from an exchange of mine with open-tech [at] bloomberg.net. I asked:
"Is there a test site that can provide a mock service, just for testing?"
and the reply was:
"No, unfortunately we do not have a publicly visible endpoint for API connections at this time. We have plans to produce a simulator that you could run on your system to build and test applications, (my enhancement) but it is not yet available."
Again, if you can tell me what your ultimate goal is, I might be able to help you. Remember that I have no experience with Perl.
I might engage a "real" programmer, versed in both Perl and C++ (and the interface between these) to help me. Can I count on your support?
-Robinson664
Mar 9, 2014 at 1:43 PM
Hi. Hope I can chime in here without ruffling any feathers. After looking into the Bloomberg API support for Perl I can conclude it is a tad messy and not really a good match for Windows programming. To start off, one needs to "build" the Bloomberg Perl API (view the README file in Bloomberg-API-Perl-3.5.0.1.zip for example) so that it hooks in to your Perl installation. Think of what CPAN does when you install any other Perl library. I believe this step is critical to get the Bloomberg Perl API to work properly. While I have not tested it, I imagine the Bloomberg Perl API would work better in a Unix or Linux environment where you have C/C++ compilers at the ready. Again view the Makefile.PL script and the resulting Makefile for dependencies needed to get this working.

As far as I can tell, to use BEmu within Perl there would need to be a similar way to "build" the BEmu DLLs into your Perl installation folders. That will likely be the trickiest part. Maybe there is a more straightforward way to do this with Perl and I am exploring it but so far does not look promising. This is not nearly as seamless as .NET/C# where all you have to do is give your project a Reference to either the BEmu DLL or the Bloomberg API DLL. Same seems to be true for Java.

My humble suggestion: If the data you need can only come from Bloomberg and you are absolutely committed and forced to use the Bloomberg API, then I suggest you pick up a Java programming book and start learning. If you have good experience programming in Perl, you should be able to get the basics of Java without much hassle. There are many examples of using Java with both BEmu and the Bloomberg API (all of Bloomberg's documentation seems to use the Java API for examples). The goal here would be to write a simplified Java program that will collect the data that you need and write it to standard output or a file. Then you can take that output and stream it into your own Perl code to manipulate the data, write it to a database and so on. For that matter, there are a number of sample Java programs that you can probably modify with little effort to fetch the data items and fields you are interested in.

As a side note, consider that Bloomberg has limitations on the amount of historical data you can fetch before they start charging you a ton of money . If the data you are looking for is equities, options or futures, you might consider other data sources that have much deeper history and fee structure that is better suited to repeated bulk access to historical data. (e.g., https://quantgo.com/).

p.s. that quote from Bloomberg about providing a simulator/test service has been a standard line from them for the past 2+ years.

Cheers,

Rich H.
Mar 9, 2014 at 3:37 PM
rholowczak wrote:
... one needs to "build" the Bloomberg Perl API.
You are absolutely right, but I did it already.
As far as I can tell, to use BEmu within Perl there would need to be a similar way to "build" the BEmu DLLs into your Perl installation folders.
I agree with that too, 100%! And indeed one option as I said in my previous post is to bring in a "real" :-) programmer to do it.
My humble suggestion: If the data you need can only come from Bloomberg and you are absolutely committed and forced to use the Bloomberg API, then I suggest you pick up a Java programming book and start learning.
(Sigh...) Reluctantly, but I tend to agree with you on this one too.
As a side note, consider that Bloomberg has limitations on the amount of historical data you can fetch before they start charging you a ton of money . If the data you are looking for is equities, options or futures, you might consider other data sources that have much deeper history and fee structure that is better suited to repeated bulk access to historical data. (e.g., https://quantgo.com/).
That might be a good idea. Doesn't it bring other interface issues as well?
p.s. that quote from Bloomberg about providing a simulator/test service has been a standard line from them for the past 2+ years.
You know, I used to be the CAD/CAM/CAE manager for a rather large corporation here. I had a lot of discussions with software vendors, software that we paid millions of dollars annually to buy and maintain. One of them told me once, "Hey, you know what are the three most prevalent white lies around? One is 'Don't worry honey, I'll be careful!' (that was before the pill...) the second is 'The check is in the mail!' (and that was before Internet bank transactions...) and the third is 'This feature will be included in the next release of software...' ." There you go!

Thanks Rich!