Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_DWX_MTX_SUBSCRIBE_MARKETDATA_ not subscribing to new symbols #92

Closed
PierrePivert opened this issue Sep 2, 2020 · 1 comment
Closed

Comments

@PierrePivert
Copy link

Hi,

Using the files available in this repo as it is, it seems that the functionality to check the Publish_MarketData to True in MT4 has been disable. Also, the list Publish_Symbols is empty.
Looking at the MQL code, I noticed that it is now possible to subscribe directly from the Python code (via the function DWX_SetSymbolList).

The function to subscribe to data from Python is DWX_MTX_SUBSCRIBE_MARKETDATA
It works great for getting to the datafeed via the appropriate port, however the function is not calling DWX_SetSymbolList, and not subscribing to any new symbol.

I added the remote_send command to add the new symbol. It may be usefull to get a local variable of subscribed symbols in the DWX_ZeroMQ_Connector class, because from what I see, adding a new symbol override all previous ones.

"""
Function to subscribe to given Symbol's BID/ASK feed from MetaTrader
"""
def _DWX_MTX_SUBSCRIBE_MARKETDATA_(self, 
                                   _symbol='EURUSD', 
                                   string_delimiter=';'):

    # Send via PUSH Socket
    _msg = "{};{}".format('TRACK_PRICES', _symbol)
    self.remote_send(self._PUSH_SOCKET, _msg)

    # Subscribe to SYMBOL first.
    self._SUB_SOCKET.setsockopt_string(zmq.SUBSCRIBE, _symbol)
    
    print("[KERNEL] Subscribed to {} BID/ASK updates. See self._Market_Data_DB.".format(_symbol))
@PierrePivert PierrePivert changed the title _DWX_MTX_SUBSCRIBE_MARKETDATA_ not subscribing to symbol data feed _DWX_MTX_SUBSCRIBE_MARKETDATA_ not subscribing to new symbols Sep 2, 2020
@PierrePivert
Copy link
Author

No need to reinvent the wheel, there is the DWX_MTX_SEND_TRACKPRICES_REQUEST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant