Please any Answer to the Question Above, it'll be really Helpful.
T for Thanks
Hello,
I have same error, I will help you. Everybody not good to help persons.
1. Make sure
- Tools/Options/Allow algorithmic trading is CHECKED,
- UNCHECK: Tools/Options/Allow algorithmic trading/Disable algorithmic trading via external Python API
2. Click "Open an Account" from File. Select correct broker and login successfully. Then you close MT5 is you like. If you had account already created from code first delete from navigator window.
I think the code works only if you had a manual successful connection to account first, then all future code connections will accept.
Remember above will work if code is correct and you get -10005, 'IPC timeout' from "mt5.last_error()".
Thank you. Be good to others too.
Hello,
I have same error, I will help you. Everybody not good to help persons.
1. Make sure
- Tools/Options/Allow algorithmic trading is CHECKED,
- UNCHECK: Tools/Options/Allow algorithmic trading/Disable algorithmic trading via external Python API
2. Click "Open an Account" from File. Select correct broker and login successfully. Then you close MT5 is you like. If you had account already created from code first delete from navigator window.
I think the code works only if you had a manual successful connection to account first, then all future code connections will accept.
Remember above will work if code is correct and you get -10005, 'IPC timeout' from "mt5.last_error()".
Thank you. Be good to others too.
Hey guys, I just stump upon the root cause of this problem, it's was very simple yet tricky. You can login first and everything does works as expected, but that's not the key.
The solution is that you have to search for your broker first, then mt5 will download the server info, then the python script will work. That also explains why some people don't run into this issue when they use their broker's mt5 instead of the official one.
copy your regular "{Mt5 data folder}\config\servers.dat" file (the one you commonly use, has previsou success login) to "Config\servers.dat", and portable=True in mt5.initialize method. This way you can pass the server data mannually
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to login to Metatrader account and I have been receiving this error code.
Please see code below;
I first import necessary libraries and initialize which works fine
But when I try to log in using the below code, I receive this error -
failed to connect at account #51166970, error code: (-10005, 'IPC timeout')
I also read some post about similar errors which asked I specify the path, please see post links (https://stackoverflow.com/questions/58028717/metatrader5-libarary-in-python-3-7 and https://stackoverflow.com/questions/63975284/mt5-metatrader-5-connect-to-different-mt5-terminals-using-python and https://www.mql5.com/en/forum/438477), so I edited my code but received this error - initialize() failed, error code = (-10005, 'IPC timeout')
As noted in an answer here (https://stackoverflow.com/questions/66492735/metatrader-error-initialize-failed-error-code-10005-ipc-timeout/72851156#72851156) I changed my path from
"C:\Program Files\MetaTrader 5\terminal64.exe"
to
"C:/Program Files/MetaTrader 5/terminal64.exe"#start the platform with initialize() if not mt5.initialize("C:/Program Files/MetaTrader 5/terminal64.exe", login=22000642, password="duzhhjkd8", server="Deriv-Demo"): print("initialize() failed, error code =", mt5.last_error()) else: mt5.login(login=22000642, password='duzhhjkd8', server='Deriv-Demo')How can I rectify this