Search code examples
c#bloomberg

Sending commands to Bloomberg terminal using Bloomberg API


I have the following code to manipulate a Bloomberg terminal, and I want to upgrade this code to use the official Bloomberg API. I have been able to download the API from Bloomberg and run the C# examples on the machine with the Bloomberg Terminal installed.

            SendKeys.SendWait("{ESC}");
            Thread.Sleep(delay);

            SendKeys.SendWait("{ESC}");
            Thread.Sleep(delay);

            SendKeys.SendWait("IB> " + uuid);
            Thread.Sleep(delay);

            SendKeys.SendWait("{ENTER}");

I am not able to find an example which is pure around executing commands (automation) on the machine they appear to be more around accessing data.

Is there a way to send commands & arguments via the Bloomberg API to the Bloomberg Terminal?


Solution

  • Bloomberg provide a Terminal Connect SDK which can be dowloaded from the Bloomberg Terminal, type SDK <Enter>. Once installed you will be able to manipulate simple functions in Bloomberg.

    For my example above I was able to start Bloomberg IB chat with the following code:

    BlpApi.Register();
    BlpTerminal.RunFunction("IB >122234", "1");
    

    However there are some drawbacks with this approach

    1. You have to have a strong named assembly and register the key with Bloomberg (this is detailed in the help files provided by the Terminal Connect SDK),

    2. There is a licensing cost to using the Terminal Connect SDK.