dingmaotu / mql-zmq

ZMQ binding for the MQL language (both 32bit MT4 and 64bit MT5)
Apache License 2.0
553 stars 301 forks source link

I’m getting “Resource timeout.. please try again.” error and... #42

Closed atillayurtseven closed 4 years ago

atillayurtseven commented 4 years ago

Hi,

I have just installed required server and client.

trades = 10
for _ in range(trades):
    _zmq._DWX_MTX_NEW_TRADE_()

the strange thing is, only second half of my orders are executed. If i set "trades" variable to 20, MT4 will open only 10 orders. If I set 2, only one order will be opened. This may help you to find the problem and possible solution.

I have not changed any default parameters. I have updated EA properties and changed Maximum orders to 10 and maximum lot size to 10.

_verbose is set to True. I can send orders anyway, the problem is totally different here.

I have two more questions

  1. Can I ask how can i reach return values of following line? “tt” is None type and doesn’t return anything. It just prints results to console.

tt = _zmq._DWX_MTX_GET_ALL_OPEN_TRADES_()

  1. How can i get last 400 OHLC data?
dingmaotu commented 4 years ago

Sorry but this is the underlying ZMQ library (only the MT4 part) that your code uses. Python part and and exact behavior of your program are specific to your server and client. Maybe you can ask the author of those programs.

atillayurtseven commented 4 years ago

Well i am asking here in case library have some problems as well.

dingmaotu commented 4 years ago

I understand. Though it is possible that the library has some problems, I think the probability is fairly low. It has been used widely for quite some time. A lot of EAs will break if this library has some fundamental problems.

I think it is related to some implementation details of your server/client protocol. Is the protocol correctly implemented? This library only defines how raw data is transmitted and don't care if the data is about "OHLC" bars or order commands.