ZeroMQ Connector failed to read response from server when compiled into a program
See original GitHub issueI was following the 7 video tutorial on how to interface python with metatrader 4 and got no problem running them on iPython kernel
By no problem I mean a trade was sent to the server with ease and client (my laptop) received proper response after each action is executed. When I call zmq._get_response_()
I can get access to server response.
The problem starts to arise when I want to compile the DWX_ZeroMQ_Connector class within a program. So I start with a simple program just like this :
def main():
zmq = DWX_ZeroMQ_Connector()
my_trade = { '_action': 'OPEN',
'_type': 0,
'_symbol': 'USOIL',
'_price': 0.0,
'_SL': 0,
'_TP': 0,
'_comment': 'dwx-zeromq',
'_lots': 0.01,
'_magic': 123456,
'_ticket': 0
}
zmq._DWX_MTX_NEW_TRADE_(_order=my_trade)
reply = zmq._get_response_()
all_trade = zmq._DWX_MTX_GET_ALL_OPEN_TRADES_()
print("reply" + str(reply))
print("----------------------")
print("alltrade"+ str(all_trade))
main()
his script STILL SENDS ORDERS SUCCESSFULLY, BUT DID NOT PROMPT ANY RESPONSE BACK as the reply turned out to be null. As I could get response and send data back and forth using ipython console, I guess you could eliminate dependencies as source of problem. Already installed the VC++ libraries from 2017.
A more comprehensive description of my issues can be found here, where I also showed my printed version in the console, logs of both MT4 Terminal and Experts and etc.
Please do not hesisitate asking me to send any additional information as I was struggling with this for quite a while. Cheers
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top GitHub Comments
Hi @SpideyAntman, could you kindly point out how can I fix my code in this case ? The example given was probably from an older version and I could not find methods that was used in the example. So far I have tried adding
This doesnt seem to work
And also tried using async function
Ah and this would not work too
Thank you, I’m glad we were able to solve this. 😃