Spezifikation

I've been studying the possibility of developing an EA that connects to other mt5 accounts and "sends" orders from the master account using the login details of the slave accounts, I wrote the code below but I can't compile it and I don't know if it makes sense.


I'm looking for someone to adjust this code and compile this EA


//+------------------------------------------------------------------+
//| Global variables declaration                                      |
//+------------------------------------------------------------------+
input string otherAccountLogin = "";    // Login of the other account
input string otherAccountPassword = ""; // Password of the other account
input string otherAccountServer = "";   // Server of the other account
int otherAccount = 0;                   // Account number of the other account

//+------------------------------------------------------------------+
//| Expert Advisor initialization function                           |
//+------------------------------------------------------------------+
int OnInit()
{
   // Connect to the other account using the provided login, password and server
   otherAccount = AccountOpen(otherAccountLogin, otherAccountPassword, otherAccountServer);
   if(otherAccount == 0)
   {
      Print("Failed to connect to the other account");
      return INIT_FAILED;
   }

   return INIT_SUCCEEDED;
}

//+------------------------------------------------------------------+
//| Expert Advisor tick function                                     |
//+------------------------------------------------------------------+
void OnTick()
{
   // Get the latest trade from the current account
   MqlTradeRequest request;
   MqlTradeResult result;
   if(!AccountTradeLast(request, result))
   {
      Print("Failed to get the latest trade from the current account");
      return;
   }

   // Execute the trade in the other account
   if(!OrderSend(otherAccount, request, result))
   {
      Print("Failed to execute the trade in the other account");
      return;
   }

   Print("Trade replicated in the other account: ", request.symbol, " ", request.action, " ", request.volume);
}


Bewerbungen

1
Entwickler 1
Bewertung
(186)
Projekte
205
26%
Schlichtung
12
25% / 58%
Frist nicht eingehalten
39
19%
Frei
2
Entwickler 2
Bewertung
(12)
Projekte
16
0%
Schlichtung
0
Frist nicht eingehalten
2
13%
Frei
3
Entwickler 3
Bewertung
(6)
Projekte
8
0%
Schlichtung
8
13% / 75%
Frist nicht eingehalten
0
Arbeitet
4
Entwickler 4
Bewertung
(553)
Projekte
627
40%
Schlichtung
2
100% / 0%
Frist nicht eingehalten
1
0%
Frei
Veröffentlicht: 9 Beispiele
5
Entwickler 5
Bewertung
(294)
Projekte
469
39%
Schlichtung
100
41% / 23%
Frist nicht eingehalten
77
16%
Beschäftigt
Veröffentlicht: 2 Beispiele
6
Entwickler 6
Bewertung
(11)
Projekte
17
59%
Schlichtung
2
0% / 100%
Frist nicht eingehalten
2
12%
Frei

Projektdetails

Budget
30 - 500 USD
Ausführungsfristen
von 1 bis 10 Tag(e)