Spécifications

//+------------------------------------------------------------------+
//|                     EA Cruzamento de Médias MT5                  |
//+------------------------------------------------------------------+
#property strict

#include <Trade/Trade.mqh>
CTrade trade;

//---- Inputs
input int FastMAPeriod = 20;
input int SlowMAPeriod = 50;
input double LotSize = 0.01;
input int StopLoss = 300;
input int TakeProfit = 600;

//---- Handles
int fastMAHandle;
int slowMAHandle;

//+------------------------------------------------------------------+
int OnInit()
{
   fastMAHandle = iMA(_Symbol, _Period, FastMAPeriod, 0, MODE_EMA, PRICE_CLOSE);
   slowMAHandle = iMA(_Symbol, _Period, SlowMAPeriod, 0, MODE_EMA, PRICE_CLOSE);
   
   if(fastMAHandle == INVALID_HANDLE || slowMAHandle == INVALID_HANDLE)
   {
      Print("Erro ao criar médias");
      return(INIT_FAILED);
   }
   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
void OnTick()
{
   if(PositionSelect(_Symbol))
      return;

   double fastMA[2];
   double slowMA[2];

   CopyBuffer(fastMAHandle, 0, 0, 2, fastMA);
   CopyBuffer(slowMAHandle, 0, 0, 2, slowMA);

   double fastCurrent = fastMA[0];
   double fastPrevious = fastMA[1];
   double slowCurrent = slowMA[0];
   double slowPrevious = slowMA[1];

   // Cruzamento para compra
   if(fastPrevious < slowPrevious && fastCurrent > slowCurrent)
   {
      trade.Buy(LotSize, _Symbol, Ask, StopLoss * _Point, TakeProfit * _Point);
   }

   // Cruzamento para venda
   if(fastPrevious > slowPrevious && fastCurrent < slowCurrent)
   {
      trade.Sell(LotSize, _Symbol, Bid, StopLoss * _Point, TakeProfit * _Point);
   }
}
//+------------------------------------------------------------------+

Répondu

1
Développeur 1
Évaluation
(35)
Projets
60
22%
Arbitrage
3
33% / 33%
En retard
15
25%
Gratuit
2
Développeur 2
Évaluation
(563)
Projets
651
33%
Arbitrage
41
41% / 46%
En retard
11
2%
Occupé
3
Développeur 3
Évaluation
(444)
Projets
701
34%
Arbitrage
34
71% / 9%
En retard
22
3%
Gratuit
4
Développeur 4
Évaluation
(1)
Projets
2
0%
Arbitrage
0
En retard
1
50%
Gratuit
5
Développeur 5
Évaluation
(19)
Projets
24
21%
Arbitrage
0
En retard
2
8%
Gratuit
6
Développeur 6
Évaluation
(28)
Projets
39
23%
Arbitrage
14
0% / 93%
En retard
4
10%
Gratuit
7
Développeur 7
Évaluation
(1)
Projets
1
0%
Arbitrage
2
0% / 50%
En retard
0
Gratuit
8
Développeur 8
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
9
Développeur 9
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
10
Développeur 10
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
11
Développeur 11
Évaluation
(49)
Projets
50
8%
Arbitrage
0
En retard
0
Gratuit
12
Développeur 12
Évaluation
(1)
Projets
0
0%
Arbitrage
5
0% / 80%
En retard
0
Gratuit
13
Développeur 13
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
14
Développeur 14
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
15
Développeur 15
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
16
Développeur 16
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
17
Développeur 17
Évaluation
(6)
Projets
8
0%
Arbitrage
8
13% / 88%
En retard
0
Gratuit
18
Développeur 18
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
19
Développeur 19
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
20
Développeur 20
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
21
Développeur 21
Évaluation
(1)
Projets
1
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 1 code
Commandes similaires
Preciso de um Expert Advisor para o MetaTrader 5 que opere a abertura do mercado na B3. Monitorização: O robô deve ler o preço teórico do leilão do contrato Cheio e do Mini simultaneamente. Cálculo de Spread: Deve calcular a distorção (ex: WDO vs DOL). Execução: Se a distorção for > X pontos, deve enviar ordem a mercado no ativo defasado exatamente no milissegundo da abertura. Volume Dinâmico: Escalabilidade de lotes
We are looking for a highly qualified, skilled, and experienced MT5 developer (ideally with experience in the financial sector and financial markets) who is capable of creating and implementing a custom-built, professional integration and analysis framework. This framework should include order flow alerts, broker anomalies (including hunting indicators, etc.), the integration of external signals, an audio alert
solicito programador que tenha experiencia em outras linguagem, para criar transferencia de dados da janela de evolucao do tempo em tempo real para EXCEL . e fazer um indicador que plot linhas no grafico com base em celula do excel. exportar da aba do times e trades informacao da aba da evolucao do tempo > excel e fazer um indicador para o profit plotar linha no grafico com base em celulas do excel
Estou procurando um trader com conhecimento em MetaTrader 5 para acompanhar e monitorar operações de trading durante o pregão. O profissional será responsável por acompanhar estratégias em execução, monitorar operações abertas e auxiliar na execução de operações no mercado futuro. Responsabilidades: Monitorar operações abertas durante o pregão Acompanhar execução das ordens e replicações no sistema Auxiliar no

Informations sur le projet

Budget
30+ USD
Délais
de 1 à 39 jour(s)