Вот как я его инициализирую.
Код: Выделить всё
import MetaTrader5 as mt5
# establish connection to the MetaTrader 5 terminal
if not mt5.initialize(login=self.login, server=self.server,password=self.password):
print("Error code:", mt5.last_error()))
mt5.shutdown()
Код: Выделить всё
if not mt5.initialize(path=self.path, login=self.login, server=self.server, password=self.password):
print("Error code:", mt5.last_error())
mt5.shutdown()
Код: Выделить всё
if not mt5.initialize():
print("Error code:", mt5.last_error())
mt5.shutdown()
Код: Выделить всё
if not mt5.initialize(path=self.path):
print("Error code:", mt5.last_error())
else:
if mt5.login(login=self.login, server=self.server, password=self.password):
print("logged in succesffully")
else:
print("Error code:", mt5.last_error())
Подробнее здесь: https://stackoverflow.com/questions/741 ... ith-python
Мобильная версия