dwx-zeromq-connector icon indicating copy to clipboard operation
dwx-zeromq-connector copied to clipboard

[Potential Bug] Subscribing to Multiple Symbols

Open octopyth opened this issue 5 years ago • 4 comments

Hi I am attempting to subscribe to more than one symbols at the same time. First I try: _zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('EURUSD') image Then I attempt to subscribe to ADD a different symbol by: _zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('GBPUSD') Nothing happens. After I unsubscribe from EURUSD then I see the GBPUSD results: _zmq._DWX_MTX_UNSUBSCRIBE_MARKETDATA_('EURUSD') image

So when subscribed to multiple symbols, only one symbol is displayed on the screen, while the expected behaviour is to see all the subscribed symbols.

Also what would be the best way to transfer these subscribed multiple symbols to SQL database for example?

octopyth avatar Jan 29 '20 17:01 octopyth

It looks like it is impossible to subscribe to multiple symbols at the same time, as subscribing is based on zmq.socket.setsockopt(zmq.SUBSCRIBE, topicfilter). If one wants to subscribe to two symbols with _zmq.DWX_MTX_SUBSCRIBE_MARKETDATA(SYMBOL_2), what happens is the TOPIC FILTER is updated with a new filter and there is only one SYMBOL being captured in _zmq._Market_Data_DB This can be validated with _zmq._Market_Data_DB[SYMBOL_1].len() and _zmq._Market_Data_DB[SYMBOL_2].len() After updating the filter, the LEN of captured entries for SYMBOL_1 remains the fixed. It contradicts to what is described here: https://youtu.be/3nM0c2kG_Sw?t=2034

octopyth avatar Feb 03 '20 17:02 octopyth

reopening issue

octopyth avatar Feb 03 '20 18:02 octopyth

Thank you for raising this @octopyth 👍

We'll try to reproduce this internally and patch the code as necessary.

Many thanks for your due diligence!

integracore2 avatar Apr 16 '20 04:04 integracore2

same issue. only one symbol in same time. the first subscribed symbol can be freeze.

ajax79 avatar Apr 29 '21 10:04 ajax79