명시

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


응답함

1
개발자 1
등급
(186)
프로젝트
205
26%
중재
12
25% / 58%
기한 초과
39
19%
무료
2
개발자 2
등급
(12)
프로젝트
16
0%
중재
0
기한 초과
2
13%
무료
3
개발자 3
등급
(4)
프로젝트
6
0%
중재
4
25% / 75%
기한 초과
0
무료
4
개발자 4
등급
(365)
프로젝트
434
35%
중재
2
100% / 0%
기한 초과
0
무료
5
개발자 5
등급
(261)
프로젝트
427
38%
중재
86
44% / 19%
기한 초과
71
17%
로드됨
6
개발자 6
등급
(11)
프로젝트
17
59%
중재
2
0% / 100%
기한 초과
2
12%
무료
비슷한 주문
olá. preciso de um expert bem especifico. ele deve ter as funcionalidades basicas, stop loss, take profit, breakevean, stop movel. com opção de configurar em pips. ele deve funcionar em qualquer ativo forex. ele deve operar de segunda a sexta, no horario especificado. e deve operar somente day trade. ou seja encerrar as ordem no final do dia. ele deve operar forex. e deve ter a opção de mudar o tipo de ponto para
EA HortiZ 30 - 100 USD
Segue o escopo do projeto; Delimitar manualmente a quantidade de operações abertas no dia simultâneamente Dias e Horário de operação = > Definição manual Encerrar as operação no dia => (Sim => definir "Horário máximo de negociação") ou (Não => Deixa como Swing Trade) Patrimônio => Limite máximo capiturado em tempo real para gerar o cálculo de Lote máximo Perda máxima no Mês => Caso atinja o valor limite não opera

프로젝트 정보

예산
30 - 500 USD
개발자에게
27 - 450 USD
기한
에서 1  10 일