EA that logs in and sends orders

Specification

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


Responded

1
Developer 1
Rating
(186)
Projects
205
26%
Arbitration
12
25% / 58%
Overdue
39
19%
Free
2
Developer 2
Rating
(12)
Projects
16
0%
Arbitration
0
Overdue
2
13%
Free
3
Developer 3
Rating
(6)
Projects
8
0%
Arbitration
8
13% / 88%
Overdue
0
Free
4
Developer 4
Rating
(574)
Projects
648
41%
Arbitration
2
100% / 0%
Overdue
1
0%
Free
Published: 9 codes
5
Developer 5
Rating
(295)
Projects
472
40%
Arbitration
103
40% / 23%
Overdue
78
17%
Busy
Published: 2 codes
6
Developer 6
Rating
(11)
Projects
17
59%
Arbitration
2
0% / 100%
Overdue
2
12%
Free
Similar orders
Buscamos um desenvolvedor MQL5 experiente para revisar e corrigir um código operacional utilizado em estratégias com derivativos na B3. É Necessário enviar comprovação de experiência real em MQL5 (portfólio, repositórios, cases, etc.). O profissional também assumirá manutenção mensal do código. Tarefas principais • Revisão completa do código, correção de inconsistências e otimizações. • Redução de latência e melhoria
Criterios de entrada: 1 stochastico em um tempo gráfico maior, por ex: 1h 1 stochastico em um tempo grafico menor, por ex: 5m *venda: quando o stoch do tempo maior estiver vendido, espera-se o stochastico do tempo menor entrar na zona de overbought e cruzar pra venda, a venda deve ser a mercado na abertura do candle seguinte ao candle que fez o stoch virar pra venda, ou seja a ordem só deve ser aberta quando o candle

Project information

Budget
30 - 500 USD
Deadline
from 1 to 10 day(s)