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

Trouble with retrieving subscriptions (Order requests are working but not subscriptions) #122

Closed
projectcarthage opened this issue Mar 3, 2021 · 12 comments

Comments

@projectcarthage
Copy link

I have sent buy and sell commands both had worked flawlessly. The issue is with the _zmq.DWX_MTX_SUBSCRIBE_MARKETDATA() command. All requests return empty dictionaries. Am I missing something?
Missing Data

@moneyrolling
Copy link

Hi, i am having similar problems too, not sure what is going on, looks like the author not actively support this development?

@projectcarthage
Copy link
Author

projectcarthage commented Mar 15, 2021 via email

@moneyrolling
Copy link

hi thanks for the reply, will you mind send me the example mt4 codes you added, thanks

@elvinex
Copy link
Collaborator

elvinex commented May 11, 2021

Hi,

I know it can be a bit confusing. But _DWX_MTX_SUBSCRIBE_MARKETDATA_() only tells zeromq that we want to subscribe to incoming data from the socket connection. However, we still have to tell MT4 to send the data.
Therefore, you need to call both functions. The second one takes a list of symbols and tells MT4 to publish data for these symbols. For example, if you want to subscribe to tick data from EURUSD and GBPUSD, use the following:

_zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('EURUSD')
_zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('GBPUSD')
_zmq._DWX_MTX_SEND_TRACKPRICES_REQUEST_(['EURUSD', 'GBPUSD'])

Then the _zmq._Market_Data_DB variable should contain the tick data for EURUSD and GPBUSD.

@TshepoMK
Copy link

Followed steps exactly as thread above and now I am getting another error. Is my internet slow or something?

Capture2

@elvinex
Copy link
Collaborator

elvinex commented May 18, 2021

The socket connection is local, so it should not depend on the internet (except the MT4 connection to the broker). In my experience a timeout can happen if you for example restart the MT4 EA multiple times and there is a problem in resetting the socket connection.

I would try restart everything (MT4 and maybe also the PC). Then first start the MT4 EA and afterwards try again from python.

@TshepoMK
Copy link

The socket connection is local, so it should not depend on the internet (except the MT4 connection to the broker). In my experience a timeout can happen if you for example restart the MT4 EA multiple times and there is a problem in resetting the socket connection.

I would try restart everything (MT4 and maybe also the PC). Then first start the MT4 EA and afterwards try again from python.

Thanks, that worked in resolving the time out error. Now I ma back to the first one where I get an empty dictionary for market data.

@elvinex
Copy link
Collaborator

elvinex commented May 18, 2021

So the MT4 EA is active with default settings and you executed both and afterwards have an empty dict?
_zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('EURUSD')
_zmq._DWX_MTX_SEND_TRACKPRICES_REQUEST_(['EURUSD'])
What is the response message from MT4? Also, what is the MT4 log showing?

@TshepoMK
Copy link

So the MT4 EA is active with default settings and you executed both and afterwards have an empty dict?
_zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('EURUSD')
_zmq._DWX_MTX_SEND_TRACKPRICES_REQUEST_(['EURUSD'])
What is the response message from MT4? Also, what is the MT4 log showing?

Capture3

@elvinex
Copy link
Collaborator

elvinex commented May 18, 2021

The second function takes a list of symbols, so that you can set all symbols you want at the same time (or remove some by omitting them). It must be (['EURUSD']) not ('EURUSD').

@TshepoMK
Copy link

The second function takes a list of symbols, so that you can set all symbols you want at the same time (or remove some by omitting them). It must be (['EURUSD']) not ('EURUSD').

Thank you @elvinex . Tbh I was about to give up.

Capture4

@elvinex
Copy link
Collaborator

elvinex commented May 18, 2021

Great to hear that it is working. :)

@elvinex elvinex closed this as completed May 18, 2021
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

4 participants