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

[RESOLVED] "Resource timeout.. please try again.” notification #53

Closed atillayurtseven closed 5 years ago

atillayurtseven commented 5 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.

NOTE: I have reinstalled VC++ reps. and after rebooting my PC, i am only getting this error message. Can not send any commands.

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?
integracore2 commented 5 years ago

Hi @atillayurtseven ,

1) You need to introduce a delay between each order send, otherwise your code will send orders faster than MetaTrader can process them.

2) To access returned values from MetaTrader, you can either access self._thread_data_output directly or call self._get_response_()

3) To access market data, you need to use self._DWX_MTX_SEND_MARKETDATA_REQUEST_()

Please also watch the following video in its entirety for more information on troubleshooting: https://www.youtube.com/watch?v=7aAsFZ_r5zU&t=1236s