I need to connect to an MetaQuotes server via the MT5Manager API (not the regular consumer version). I double checked the credentials, but it is failing to connect without any helpful message.
`from MT5Manager import ManagerAPI
def main():
# Initialize ManagerAPI object
# Specify server, login, and password
server = "MT5SERVER:443"
login = 1234 # Your MT5 account login
password = "*******************"
# Initialize ManagerAPI object with server, login, and password
manager = ManagerAPI(server=server, login=login, password=password)
# Connect to MetaTrader 5 Manager
res = manager.Connect()
if not res:
print("Failed to connect to MetaTrader 5 Manager")
return
# Subscribe to EURUSD ticks
if not manager.symbol_subscribe("EURUSD"):
print("Failed to subscribe to EURUSD ticks")
manager.disconnect()
return
# Retrieve ticks for EURUSD
ticks = manager.get_ticks("EURUSD")
if ticks is not None:
print("Ticks for EURUSD:")
for tick in ticks:
print(tick)
# Disconnect from MetaTrader 5 Manager
manager.disconnect()
if name == “main“:
main()
`
Any suggestions?
Connect() returns False.
New contributor
user24959463 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.