Since python eikon is slow for real-time data, can I call EikonDesktopDataAPI.dll or EikonOfficeShim.dll from python? Is there a better way to do it using eikon api?
You can use some of the Eikon COM APIs in Python, but only in 32-bit Python. See this article for an example. You can use the same technique described in the article with AdfinX Real-Time COM library to subscribe to streaming market data.To tell if there's "a better way to do it" we need to know what "it" is. Would you care to describe your use case? What is the end goal you're looking to accomplish and what constraints and challenges are you facing?I wouldn't say that Eikon Data APIs is "slow" for retrieving market data. For snapshot retrieval of market data it's perfectly adequate. What it doesn't do yet is provide capability to retrieve streaming market data. If you need to stream real-time market data, then at the moment you need to use either Eikon COM or Eikon .NET APIs.
Thanks, Alex. My use case is to get futures and swaps real-time data in order to build curve in real-time. I found if I see eikon python API, it took me 3-4 secs to get all the data back through eikon.get_data(...) calls (there are four calls in total). By the way, I can't merge them as they require different fields.
If I go to follow the article you mentioned above, will it be faster?
Any suggestion is welcomed!
Peng
If you only need a snapshot of this data and you don't care to receive streaming updates, then retrieving data using Eikon COM or .NET APIs will not necessarily be faster. You don't need to split your data retrieval into several get_data calls. Calling get_data multiple times will indeed linearly increase the retrieval time, because get_data method is executed synchronously. I don't quite understand what you mean when you say you cannot merge the calls because they require different fields. You can retrieve all the fields you need in one call. Some fields may not exist for some instruments. For these RIC/field combinations the resulting dataframe will contain None or NaN.
Good to know. I will try to do so.
Thanks, Alex. I tried it and it is faster than before (half of time saved). But I compare it with excel TR call. In excel function is still much faster. Is there possible I can get similar speed as excel function? I guess it is because of multiprocess/multithread in excel?