darwinex / dwx-zeromq-connector

Wrapper library for algorithmic trading in Python 3, providing DMA/STP access to Darwinex liquidity via a ZeroMQ-enabled MetaTrader Bridge EA.
https://blog.darwinex.com/zeromq-interface-python-r-metatrader4/
BSD 3-Clause "New" or "Revised" License
344 stars 228 forks source link

[SOLVED] Connectivity between MQL4 EA and Python script #24

Closed felixfxfx closed 5 years ago

felixfxfx commented 5 years ago

Hello, I cannot seem to get the ZMQ EA to perform basic tasks reliably or at all.

_zmq.DWX_MTX_GET_ALL_OPEN_TRADES() responds with “Resource timeout… please try again.”

If I subscribe: _zmq.DWX_MTX_SUBSCRIBE_MARKETDATA(_symbol=‘EURUSD’)

it will tell me the Kernel subscribed but _zmq._Market_Data_DB.keys() will respond with dict_keys([]), meaning there is no data for EURUSD.

I’ll get “KeyError: 'EURUSD” when I _zmq._Market_Data_DB[‘EURUSD’] eventhough it saids it is subscribed.

I am wondering whether I have this EA installed correctly or it is bugged. When I go into the dependencies, I see a ton of red flags. I followed the instructions on the site to a T, dropping the Zml and Mql folders into Include as-is, putting libsodium.dll and libzmq.dll into the Libaries folder, and also installed pyzmq via pip install pyzmq in command line. The EA is in the experts folder and I did a %run for the .py file before running the commands in the Ipython shell.

Is there more that I need to do that is not mentioned on the instructions page that maybe perhaps they are just a given assumption for someone who is more experienced?

I am at a loss now as to how to make this work. I need this ZMQ EA to come to a place where I can trust it to work so I can continue developing my algorithm. The idea of binding Python to MT4 is extremely promising.

Thank you so much for your help and for your time.

felixfxfx commented 5 years ago

I also want to mention that the Experts Tab in MT4 states that the EA was initialized and that it is being MT4 to to ports. It also starts pushing subscribe info through the PUB socket when I set Publish_marketData to true. It does not get picked up from the Python end.

AloftLab commented 5 years ago

DWX_ZeroMQ_Connector_v2_0_2_RC1.py has same problem with me as described from felixfxfx

That is with with 2.0.2 version. 2.0.1 worked and data was published. Problem in 2.0.1 or 2.0.2 accoure as well with coinflip ea wich opened trades just none is closed by it.

coinflip trader currently gave me error: Exception Type TypeError. Args: ("'bool' object is not iterable",) None Process finished with exit code -1

felixfxfx commented 5 years ago

It did not appear 2.0.2 was complete so I am using 2.0.1 instead.

This issue is also being discussed at this thread here: https://community.darwinex.com/t/dwx-zeromq-connector-v2-0-1-help-please/6038/9

AloftLab commented 5 years ago

These was it!! tnx guys. Keep on good work!

integracore2 commented 5 years ago

Thank you for your kind feedback @matjazzh and @felixfxfx 🙂

Glad we were able to solve the issues together!