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
347 stars 229 forks source link

[Socket Monitoring] How to deal with EVENT_CONNECT_DELAYED #31

Closed efeveret01 closed 5 years ago

efeveret01 commented 5 years ago

Initializing the connector results in a PUSH socket EVENT_CONNET_DELAYED error. My ea works with the smiley face at the top right corner, but the pythons script is not connecting to the platform.

INPUT: import zmq from DWX_ZeroMQ_Connector_v2_0_1_RC8 import *

_zmq = DWX_ZeroMQ_Connector() _zmq._verbose

OUTPUT: [INIT] Ready to send commands to METATRADER (PUSH): 32768 [INIT] Listening for responses from METATRADER (PULL): 32769 [INIT] Listening for market data from METATRADER (SUB): 32770

[KERNEL] Retrieving ZeroMQ Monitor Event Names:

32 : EVENT_ACCEPTED 64 : EVENT_ACCEPT_FAILED 65535 : EVENT_ALL 16 : EVENT_BIND_FAILED 128 : EVENT_CLOSED 256 : EVENT_CLOSE_FAILED 1 : EVENT_CONNECTED 2 : EVENT_CONNECT_DELAYED 4 : EVENT_CONNECT_RETRIED 512 : EVENT_DISCONNECTED 16384 : EVENT_HANDSHAKE_FAILED_AUTH 2048 : EVENT_HANDSHAKE_FAILED_NO_DETAIL 8192 : EVENT_HANDSHAKE_FAILED_PROTOCOL 4096 : EVENT_HANDSHAKE_SUCCEEDED 8 : EVENT_LISTENING 1024 : EVENT_MONITOR_STOPPED

[KERNEL] Socket Monitoring Config -> DONE!

[PUSH Socket] >> EVENT_CONNECT_DELAYED[Finished in 1.0s]

integracore2 commented 5 years ago

Hi @efeveret01 ,

Thank you for your query.

Please initialize the DWX_ZeroMQ_Connector object with _monitor=False and try again. The socket monitoring feature is experimental at this point in time, in that we are exploring its utility in future versions.

It has been provided to users at the present time as a means of evaluating concentration of EVENTs experienced in the current version.

Please note that these are not errors, they are EVENTS -> they are meant to give you a visual of exactly what causes data exchange to (or not to) occur.

Hope this helps!

efeveret01 commented 5 years ago

tks that helped