MT5 Connection

295 views
Skip to first unread message

Simon Poon

unread,
Apr 2, 2019, 1:17:32 AM4/2/19
to NJ4X Forum

Dear All, 


I want to test the MT5 connection. I started the NJ4X Terminal Server and ran the MT4ConnectionExample. After that I got the  log4j error and the invalid username or password message. I can login MT5 terninal by using this account.  How can I solve the log4j error and login correctly? 


Thank you for your help!


e.JPG


p.JPG


Roman Gerasimenko

unread,
Apr 3, 2019, 4:42:11 AM4/3/19
to NJ4X Forum
Please try new Broker("5*78.140.180.198") instead...

MT5 connection procedure differs a little bit from MT4 because MT5 terminals does not use SRV configuration files.

You needed to find broker's IP address. To do that connect your account manually and check active mt5 terminal socket connections using broker_ip.bat utility (you can use MS Process Explorer as alternative). 

To connect mt5 broker you need to know its IP address, then you simply construct broker object and pass it to connect method like this:   

s.connect(ts_host, ts_port, new Broker("5*<broker_ip>"), usr, passwd)   (e.g. in case broker IP is 78.140.180.198 - new nj4x.Metatrader.Broker("5*78.140.180.198")  )


вт, 2 квіт. 2019 о 08:17 Simon Poon <sim...@gmail.com> пише:
--
You received this message because you are subscribed to the Google Groups "NJ4X Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nj4x+uns...@googlegroups.com.
To post to this group, send email to nj...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages