I am using python to write some trading code, however, I have received error as above. I know it connected to MT5 since I also tried different account I had for connection and it works, however, I am unable to retrieve any account information.
Anyone experience enough to help? Would I be missing some installation? I am building this from VSCode if you are asking.
import MetaTrader5 as mt5
from datetime import datetime
if not mt5.initialize():
print("initialize() failed, error code =",mt5.last_error())
quit()
D_login = xxx
D_pw = xxx
D_Server = xxx
mt5.login(D_login, D_pw, D_Server)
acc_info = mt5.account_info
print(acc_info)
bal = acc_info.balance
equity = acc_info.equity
print('Balance :', bal)
print('Equity :', equity)
Change
mt5.account_info
tomt5.account_info()
. You need to call the function.