Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Verification of MT4 account from MQL4 (tested in version 880) - MetaTrader 4 Library

author EAcpu | 6 reads | 0 comments |

Since the release of MetaTrader 4 build 880, it is no longer easy to programmatically fill values ​​in the login dialog.

The library hides the complexity and provides an easy-to-use API for logging into any MetaTrader 4 account from MQL4 Script/Expert.

Any contributions are appreciated.

 //+------------------------------------------------------------------+
//| mql4-auth-example.mq4 |
//| Copyright 2015, Sergey Lukin |
//+------------------------------------------------------------------+
#include //+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
blank start ()
  { // Just in case... if (loginDialogIsOpen()) closeLoginDialog(); // Let's get started! if (Authorization( "Account" , "Password" , "Server IP/Host Name" ))
    {
print ( "Hooray, I found the login dialog, inserted my credentials and now wait for MT4 to connect :)" );
    }
other {
print ( "Sorry, I can't even find the login dialog... Is your MT4 older than v880?" );
    }
  } //+------------------------------------------------------------------+

source:

The source code is released in the Github repository . Any contribution will be highly appreciated.


Attachment download

📎 mql4-auth.mqh (4.74 KB)

📎 mql4-auth-example.mq4 (1.01 KB)

Source: MQL5 #13903

Verification code Refresh