pythonmetatrader5

Metatrader 5 login() broken after update?


We developed some moths ago a bunch of python scripts that use Metatrader 5 library (5.0.34).

Since client's update 5.00 (the lib requires a running client), previously working login() function seems broken:

SEVERE LOGIN FAIL error code: (-2, 'Terminal: Invalid params')

Previously-called mt5.initialize(login,password,server) function still seems to be working, it doesn't raise any exception. Current client version is 5.00 build 3033. The client itself is working

enter image description here


Solution

  • With new mt5 version, "server" has become mandatory.

    Specyfying it in both initialize() and login() calls, made it.