我有多个python程序,使用以下代码连接到Mt5终端。
# Establish connection to the MetaTrader 5 terminal
if not mt5.initialize("C:\\Program Files\\ICMarkets - MetaTrader 5 - 01\\terminal64.exe"):
print("initialize() failed, error code =", mt5.last_error())
quit()
The python module for MT5 is the one here - https://www.mql5.com/en/docs/integration/python_metatrader5
The problem I have is that, when multiple programs connect to the same MT5 terminal.exe
, the performance degrades & one or more python programs exit with errors. To overcome this, I have installed multiple copies of MT5 & have updated the python code such that different copies of python program use different installations of MT5. However, only the first installation of MT5 is the only one that can be invoked by all the python programs. Trying to use any other terminal.exe
from other installation raises an exception & the connection fails.
互联网上也没有什么可以解决这个问题的方法。如果有人有办法解决这个问题,或者已经解决了这个问题,我很想听听你的意见。
这样的错误是--
initialize() failed, error code = (-10003, "IPC initialize failed, Process create failed 'C:\\Program Files\\ICMarkets - MetaTrader 5 - 02\terminal64.exe'")
这可能与Windows的默认指向第一次安装或类似的东西有关,你甚至不会想到。只是在这里大声思考。