Tarea técnica

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);
}


Han respondido

1
Desarrollador 1
Evaluación
(186)
Proyectos
205
26%
Arbitraje
12
25% / 58%
Caducado
39
19%
Libre
2
Desarrollador 2
Evaluación
(12)
Proyectos
16
0%
Arbitraje
0
Caducado
2
13%
Libre
3
Desarrollador 3
Evaluación
(6)
Proyectos
8
0%
Arbitraje
8
13% / 88%
Caducado
0
Libre
4
Desarrollador 4
Evaluación
(611)
Proyectos
688
42%
Arbitraje
2
100% / 0%
Caducado
1
0%
Trabaja
Ha publicado: 9 ejemplos
5
Desarrollador 5
Evaluación
(298)
Proyectos
477
40%
Arbitraje
105
40% / 24%
Caducado
81
17%
Trabajando
Ha publicado: 2 ejemplos
6
Desarrollador 6
Evaluación
(11)
Proyectos
17
59%
Arbitraje
2
0% / 100%
Caducado
2
12%
Libre

Información sobre el proyecto

Presupuesto
30 - 500 USD
Plazo límite de ejecución
de 1 a 10 día(s)