Why does my python script need to open Mt5's window to work ?

 

blblablabl


Hello, 


I use MetaTrader5 library for python.
I call connectToAccount from main function.


I don't understand why MetaTrader5's window needs to be open.
If I block this opening my script sleeps until the window is opened.

Is there a way to make it work without opening the Mt5 window ?

Thank you ! 

import MetaTrader5 as mt5

def connectToAccount(account, pswd):
        if not mt5.initialize():
                print("initialize() failed, error code =", mt5.last_error())
                quit()

        account = *****
        authorized = mt5.login(account, password="******")
        if authorized:
                        print("Connected to account #{} ".format(account))
        else:
                print("failed to connect at account #{}, error code: {}".format(
                        account, mt5.last_error()))


mtAccount.connectToAccount("******", "*******")
mtAccount.disconnectToAccount()
 
XasmY: I use MetaTrader5 library for python. I call connectToAccount from main function. I don't understand why MetaTrader5's window needs to be open. If I block this opening my script sleeps until the window is opened. Is there a way to make it work without opening the Mt5 window ?

Obviously because the MetaTrader terminal is the actual work-horse that does all the main work of collecting the data from the broker and sending and processing all the trading details. It works as server environment where the python integration is a client environment.

 
Fernando Carreiro:

Obviously because the MetaTrader terminal is the actual work-horse that does all the main work of collecting the data from the broker and sending and processing all the trading details. It works as server environment where the python integration is a client environment.

So it's not possible to not open the window ? 

 
XasmY:

So it's not possible to not open the window ? 

It seems like i hv a serial problem with my account...

It only operates in google but cant be authorized in MQL5


WHAT SHOULD I DO TO LOGIN IN MY MT5 APP??
 
Theetso Matlhola:
It seems like i hv a serial problem with my account...

It only operates in google but cant be authorized in MQL5


WHAT SHOULD I DO TO LOGIN IN MY MT5 APP??

If you can not login to your trading account so ask your broker for support.

If you can not fill Community tab of Metatrader so use your forum login and forum password to login.
Your forum login is theetsomatlhola-gmail (do not use your email to login).

If you registered here using facebook or google so you can change your password:

Forum on trading, automated trading systems and testing trading strategies

i can't login with my google account because mt4 pc terminal not have google login options

Sergey Golubev, 2020.08.05 21:49

If you forgot your password, or you registered using google or facebook so use the following link to get new password for example:
https://www.mql5.com/en/auth_forgotten

Reason: