MetaTrader5 initialize in Python timing out with 'IPC timeout'

 

I'm running Python from Anaconda shell to connect to Metatrader 5:

import MetaTrader5 as mt5 if mt5.initialize(path="C:/Program Files/MetaTrader 5/terminal64.exe", timeout=180000): print("connexion to MT5 is OK") else : print("initialize() failed, error code =",mt5.last_error()) quit() authorized=mt5.login(login=account, server="Coinexx-Live", password=password)

It opens the MT5 terminal and logs in but never gets a successful return value. It hangs for the timeout duration and then times out:

    failed to connect at account #935240, error code: (-10005, 'IPC timeout')

Why would this happen?

OOP in MQL5 by Example: Processing Warning and Error Codes
OOP in MQL5 by Example: Processing Warning and Error Codes
  • www.mql5.com
The article describes an example of creating a class for working with the trade server return codes and all the errors that occur during the MQL-program run. Read the article, and you will learn how to work with classes and objects in MQL5. At the same time, this is a convenient tool for handling errors; and you can further change this tool according to your specific needs.
Reason: