ejtraderLabs / ejtraderMT

Metatrader 5 API - Trading and history OHLC Dataframe in Nano Seconds
GNU General Public License v3.0
70 stars 28 forks source link

Data socket timeout ERROR MT5 DOCKER AND WINDOWS #10

Closed DiMiTriFrog closed 10 months ago

DiMiTriFrog commented 11 months ago

I was using the Docker version with mac and linux fine but suddenly the library stopped working. I thought that was the time to get Windows VPS so i now i have already installed all needed bu i'm having the same error.

Code i'm running:

from ejtraderMT import Metatrader
api = Metatrader()

ERROR WINDOWS:

Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\ejtraderMT\api\mql.py", line 71, in _pull_reply msg = self.sys_socket.recv_json() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\zmq\sugar\socket.py", line 1009, in recv_json msg = self.recv(flags) ^^^^^^^^^^^^^^^^ File "zmq\backend\cython\socket.pyx", line 805, in zmq.backend.cython.socket.Socket.recv File "zmq\backend\cython\socket.pyx", line 841, in zmq.backend.cython.socket.Socket.recv File "zmq\backend\cython\socket.pyx", line 199, in zmq.backend.cython.socket._recv_copy File "zmq\backend\cython\socket.pyx", line 194, in zmq.backend.cython.socket._recv_copy File "zmq\backend\cython\checkrc.pxd", line 22, in zmq.backend.cython.checkrc._check_rc zmq.error.Again: Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Administrator\met.py", line 3, in api = Metatrader() ^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\ejtraderMT\api\mql.py", line 138, in init self.utc_brocker_offset = self.___utc_brockeroffset() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\ejtraderMT\api\mql.py", line 407, in utc_brocker_offset broker = self.accountInfo() ^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\ejtraderMT\api\mql.py", line 279, in accountInfo return self.__api.Command(action="ACCOUNT") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\ejtraderMT\api\mql.py", line 113, in Command return self._pull_reply() ^^^^^^^^^^^^^^^^^^ File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\ejtraderMT\api\mql.py", line 73, in _pull_reply raise zmq.NotDone("Data socket timeout ERROR") zmq.error.NotDone: Data socket timeout ERROR

DiMiTriFrog commented 11 months ago

I want to add that using MetaTrader5 library i can connect it and work with it, but its a bullshit lib, i prefer yours.

DiMiTriFrog commented 10 months ago

In addition, i'm not able to build the ejtrader Expert into Metatrader... there is warnings and errors previous to build.

Could you help me?? I'm so interested in try it.

@traderpedroso

DiMiTriFrog commented 10 months ago
Screenshot 2023-08-11 at 12 13 33
traderpedroso commented 10 months ago

docker pull for the last version or clone the repository of MT5 DOCKER

DiMiTriFrog commented 10 months ago

docker pull for the last version or clone the repository of MT5 DOCKER

i tried and worked, but suddenly let works, so i'm trying to install from zero

traderpedroso commented 10 months ago

docker pull for the last version or clone the repository of MT5 DOCKER

i tried and worked, but suddenly let works, so i'm trying to install from zero

make sure to pip install ejtraderMT -U to install the last version of the library

DiMiTriFrog commented 10 months ago

Yes i did, but same.. :(

makovez commented 9 months ago

I have same problem here:

(py311) MetaTrader5:~# python
Python 3.11.5 (main, Aug 26 2023, 10:26:28) [GCC 13.1.1 20230722] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ejtraderMT import Metatrader

>>> 
>>> api = Metatrader()
/root/py311/lib/python3.11/site-packages/tzlocal/unix.py:158: UserWarning: Can not find any timezone configuration, defaulting to UTC.
  warnings.warn('Can not find any timezone configuration, defaulting to UTC.')
Traceback (most recent call last):
  File "/root/py311/lib/python3.11/site-packages/ejtraderMT/api/mql.py", line 71, in _pull_reply
    msg = self.sys_socket.recv_json()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/py311/lib/python3.11/site-packages/zmq/sugar/socket.py", line 1009, in recv_json
    msg = self.recv(flags)
          ^^^^^^^^^^^^^^^^
  File "zmq/backend/cython/socket.pyx", line 805, in zmq.backend.cython.socket.Socket.recv
  File "zmq/backend/cython/socket.pyx", line 841, in zmq.backend.cython.socket.Socket.recv
  File "zmq/backend/cython/socket.pyx", line 199, in zmq.backend.cython.socket._recv_copy
  File "zmq/backend/cython/socket.pyx", line 194, in zmq.backend.cython.socket._recv_copy
  File "zmq/backend/cython/checkrc.pxd", line 22, in zmq.backend.cython.checkrc._check_rc
zmq.error.Again: Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/py311/lib/python3.11/site-packages/ejtraderMT/api/mql.py", line 138, in __init__
    self.__utc_brocker_offset = self.___utc_brocker_offset()
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/py311/lib/python3.11/site-packages/ejtraderMT/api/mql.py", line 407, in ___utc_brocker_offset
    broker = self.accountInfo()
             ^^^^^^^^^^^^^^^^^^
  File "/root/py311/lib/python3.11/site-packages/ejtraderMT/api/mql.py", line 279, in accountInfo
    return self.__api.Command(action="ACCOUNT")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/py311/lib/python3.11/site-packages/ejtraderMT/api/mql.py", line 113, in Command
    return self._pull_reply()
           ^^^^^^^^^^^^^^^^^^
  File "/root/py311/lib/python3.11/site-packages/ejtraderMT/api/mql.py", line 73, in _pull_reply
    raise zmq.NotDone("Data socket timeout ERROR")
zmq.error.NotDone: Data socket timeout ERROR
DiMiTriFrog commented 9 months ago

i'm think the issue is because the broker we are using does not allow the version of metatrader is using on the Docker. I put an issue here https://github.com/ejtraderLabs/Metatrader5-Docker/issues/6 asking for an update!

makovez commented 9 months ago

i'm think the issue is because the broker we are using does not allow the version of metatrader is using on the Docker. I put an issue here https://github.com/ejtraderLabs/Metatrader5-Docker/issues/6 asking for an update!

No cause I'm not even logged in, I just try to initialize that class Metatrader().

I can't even find the server for my broker which is tick mill from the GUI.

DiMiTriFrog commented 9 months ago

i'm think the issue is because the broker we are using does not allow the version of metatrader is using on the Docker. I put an issue here ejtraderLabs/Metatrader5-Docker#6 asking for an update!

No cause I'm not even logged in, I just try to initialize that class Metatrader().

I can't even find the server for my broker which is tick mill from the GUI.

what server is?

makovez commented 9 months ago

Should be this demo.mt5tickmill.com

But in my terminal on my windows installation I just select tick mill eu demo.

DiMiTriFrog commented 9 months ago

Wtf... But if you are using Windows, you are using metatrader for windows, not using Docker, right?

So you have to install the plugin of EJTrader in your metamask to allow connect using python sockets

makovez commented 9 months ago

I'm saying in my windows regular installation of mt5 I can see the tickmill server but in the docker one from this repo I can't see it.

I wonder if I can change the terminal.exe with mine.