phpmql

MQL4/5 how to make connection (login) to broker with PHP


I am creating website in php that will store user account number, password and broker name (ip), that account will be connected automaticaly to MQL4/5 software in same moment user saves data in database.

Problem i have now is that user can save invalid data that will cause invalid connection to MQL4/5, and i want to check it to be sure all is valid before connection.

Is there any way to connect to broker with php or js, and check if credentials are correct (account number and password) before i store it into database ?

Thanks in advance.


Solution

  • Yes, but it's not easy.

    You can only authenticate with a broker's Metatrader server using a Metatrader client terminal.

    That being said, you could launch a Metatrader web-terminal in a headless selenium instance, login using the supplied credentials, and check the authentication result from the resulting html.

    enter image description here