login to an account using EA - page 2

 
jjc:
It's not really answering your question, but personally I'd say that this sort of kludge to log in to different accounts by simulating keystrokes is suicidally dangerous. [...]
I second this. I have used this method for demo accounts a long long time ago and found it extremely unreliable.
 
I don't need to know how to start MT4 other than us doing it ourselves. My quandary is how to find out when the account is sitting idle and then change to a different account # along with have the appropriate charts profile change along with them.
 
As informed by Gordon, the Help files say that one can modify the start.ini file for startup options and might accomplish it that way. But looking in the config folder there is no actual start.ini file there at all. Perhaps it is optional. There is a number of other ones, most of which are complied. But there are two files:Terminal.ini and MetaEditor.Ini files that are text files, but for the most part they just have information about the physical layout and configuration of these two executable programs.
 

How can I use command to call window "login" in menu File/Login ?



I also want to write text on three text box of Login, Password, Server and remove tick of "Save account information".

Please help me.

Thanks!

 
Can you please stop posting the same question across many old threads . . .
 
Just send us the right link of this topic RaptorUK. Thanks
 

OK. I must ask here because I dont speak russian and this forum ( https://forum.mql4.com/ru/10784 ) I dont understand.

Im trying to build a script for continuous login where I will read all login data from a CSV file. But I have some troubles with accessing the Login dialog window and his inputs.

I will be very glad if somebody can help me with this code:

void start() {
   Comment("Login start");

   Sleep(10000);

   hterminal=GetAncestor(WindowHandle(Symbol(),Period()),2);          
   if(hterminal!=0) {

      hwindow=GetLastActivePopup(hterminal);

      //Open Login dialog window
      PostMessageA (hwindow, WM_COMMAND, 35429,0); // OR use PostMessageA (hwindow, WM_COMMAND, 0x8A65,-0x30107D);

      if(hwindow != 0){
         Print ("Window ok.");

         //Cursor first field
         PostMessageA(hwindow,WM_COMMAND,VK_TAB,0); 

         //Login numbers:
         PostMessageA(hwindow,WM_KEYDOWN,VK_1,0); //???KEYBDINPUT???
         PostMessageA(hwindow,WM_KEYDOWN,VK_2,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_3,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_4,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_5,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_6,0);

         //Cursor to password field
         PostMessageA(hwindow,WM_COMMAND,VK_TAB,0); 

         //Password chars:
         PostMessageA(hwindow,WM_KEYDOWN,VK_A,0); //???KEYBDINPUT???
         PostMessageA(hwindow,WM_KEYDOWN,VK_B,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_C,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_D,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_E,0);
         PostMessageA(hwindow,WM_KEYDOWN,VK_F,0);         

         //Enter to confirm
         PostMessageA(hwindow,WM_KEYDOWN,VK_ENTER,0); 
      }

   }

   else Print("Login Error:",GetLastError());

   return;

}   
 
krana:

Can I use an EA to auto-login different accounts?

if i have sereral different accounts,and i want to trade with all of them,can i first login with one account,send orders,then login with another account and send the same orders?

Why bother. Just create multiple terminal installs, one per account. Each one handles it's own account just as each EA handles it's own chart (pair/TF)
 
WHRoeder:
Why bother. Just create multiple terminal installs, one per account. Each one handles it's own account just as each EA handles it's own chart (pair/TF)
So WHRoeder this is my current solution. I have 49 instances of MetaTrader at VPS and its very hard for it. There are no possible to open more than fifty MetaTraders. I have a service which showing online results for each trader and I need find better solution than I have.

Any idea?
 
I mean read all logins credentials from CSV file (that I can edit) will be more efective than install of MetaTrader for each new trader...