MQL5 Python issue


I Am Trading Using Python code And MQl5 Library

When My Trade Keeps Running For More than 12 hrs or 13 hrs maybe

MT5 Client Starts Giving Me The Following Issue

ConnectionRefusedError: [Errno 111] Connection refused

Traceback (most recent call last):

  File "", line 515, in <module>

    client = ForexClient(login=****, server="****", password="*****")

  File "", line 30, in _init_

    self.mt5 = MetaTrader5(port=self.port)

  File "/home/ubuntu/.local/lib/python3.8/site-packages/mt5linux/", line 364, in __init_

    self.__conn = rpyc.classic.connect(host,port)

  File "/home/ubuntu/.local/lib/python3.8/site-packages/rpyc/utils/", line 76, in connect

    return factory.connect(host, port, SlaveService, ipv6=ipv6, keepalive=keepalive)

  File "/home/ubuntu/.local/lib/python3.8/site-packages/rpyc/utils/", line 98, in connect

    s = SocketStream.connect(host, port, ipv6=ipv6, keepalive=keepalive)

  File "/home/ubuntu/.local/lib/python3.8/site-packages/rpyc/core/", line 173, in connect

    return cls(cls._connect(host, port, **kwargs))

  File "/home/ubuntu/.local/lib/python3.8/site-packages/rpyc/core/", line 125, in _connect

    s = socket_backoff_connect(family, socktype, proto, sockaddr, timeout, attempts)

  File "/home/ubuntu/.local/lib/python3.8/site-packages/rpyc/lib/", line 131, in socket_backoff_connect


ConnectionRefusedError: [Errno 111] Connection refused