I am migrating an application to Eikon, and I am getting some serious issues with the time series subscription. This is my first encounter with Eikon and TR in general (although I have experience with other platforms), so I think this might simply be a case of teething issues.
What I'm trying to achieve is fairly simple. My application acts as a gateway for other applications (for simplicity, let's call them clients) to receive minute-by-minute OHLCV pricebars of a set of stocks. Upon startup, each client connects to the gateway, which then sets up an input and output thread, through which my clients instruct the gateway to request time series subscriptions for a list of stocks, (unless a subscription already exists for that stock). When a pricebar is received, it is sent to each client that wants to receive it.
However, I'm having some issues, and I can't quite pinpoint the causes.
1) I don't know when a pricebar is 'finished'. All I know is when a new bar arrives, from the 'NewPoint' UpdateType. Because of this, I have two options: consider the pricebar 'closed' at 0 seconds past the minute [according to my local machine time, perhaps risking loss of information], or use the 'NewPoint' property of a new bar as a signal to consider the current pricebar as closed (which I use, and justify because the 'NewPoint' bar has no OHLC data). On this assumption, the first price bar to 'complete' always does so around 5 seconds after its quoted time, whereas I need it to arrive as soon as possible.
2) The second to arrive in a given minute comes at any point between that time and 35 seconds past the minute, if it arrives at all. When I have, for example, 4 stocks' time series subscribed, after ten minutes I only have pricebars for one or two stocks coming in every minute, with the remaining two simply not arriving (the receiving function on the gateway application simply isn't called for that stock). What I'm looking for is every pricebar to arrive for the full duration of the market hours, and within e.g. the first second of each minute.
Unfortunately, the guide only gives a limited range of examples (e.g. a single subscription).
A) Perhaps I should be loading all stocks into a single subscription, rather than creating separate subscriptions for each stock? I am storing the subscriptions in a list, just incase they don't stay alive otherwise.
Or maybe there are problems with the Eikon API in a threaded application? The requests are performed by the "input" threads for each respective client.
C) I am creating the subscriptions on the same TimeSeriesDataService. Whilst I can't see any reason for this to be out of the ordinary, could this be the source of my problems?
D) On the assumption that I can't achieve my requirements with a time series subscription, I have decided to start looking into forming my own pricebars from RealTimeData, forming OHLCV bars every minute. This data seems to be very useful, and I'm reasonably comfortable with this idea. As I'm looking at both price and volume, I use SetupDataRequest. I need slight clarification so that I am not operating under any assumptions - do the trade fields, e.g. TRDPRC_1, ALWAYS become TRDPRC_2 in the following update, or is it possible that multiple 'fresh' trades occur in a single update? Is the RealTimeData subscription guaranteed to always contain every trade?
Thanks for any help. I can provide a MWE on request, but I've hopefully provided enough information.