Tarea técnica

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

Han respondido

1
Desarrollador 1
Evaluación
(35)
Proyectos
61
23%
Arbitraje
4
50% / 25%
Caducado
15
25%
Libre
2
Desarrollador 2
Evaluación
(607)
Proyectos
704
33%
Arbitraje
43
47% / 44%
Caducado
13
2%
Ocupado
3
Desarrollador 3
Evaluación
(454)
Proyectos
718
34%
Arbitraje
35
69% / 9%
Caducado
22
3%
Trabaja
4
Desarrollador 4
Evaluación
(2)
Proyectos
3
0%
Arbitraje
0
Caducado
2
67%
Libre
5
Desarrollador 5
Evaluación
(27)
Proyectos
33
36%
Arbitraje
0
Caducado
2
6%
Libre
6
Desarrollador 6
Evaluación
(28)
Proyectos
39
23%
Arbitraje
14
0% / 93%
Caducado
4
10%
Libre
7
Desarrollador 7
Evaluación
(1)
Proyectos
1
0%
Arbitraje
2
0% / 50%
Caducado
0
Libre
8
Desarrollador 8
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
9
Desarrollador 9
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
10
Desarrollador 10
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
11
Desarrollador 11
Evaluación
(50)
Proyectos
51
8%
Arbitraje
0
Caducado
0
Libre
12
Desarrollador 12
Evaluación
(1)
Proyectos
0
0%
Arbitraje
5
0% / 80%
Caducado
0
Libre
13
Desarrollador 13
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
14
Desarrollador 14
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
15
Desarrollador 15
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
16
Desarrollador 16
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
17
Desarrollador 17
Evaluación
(6)
Proyectos
8
0%
Arbitraje
8
13% / 88%
Caducado
0
Libre
18
Desarrollador 18
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
19
Desarrollador 19
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
20
Desarrollador 20
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
21
Desarrollador 21
Evaluación
(2)
Proyectos
2
0%
Arbitraje
0
Caducado
0
Libre
Ha publicado: 1 ejemplo
Solicitudes similares
I am looking for a Pine Script v6 developer to create a TradingView indicator based on liquidity and Smart Money Concepts. The indicator must detect, mark on the chart, and optionally trigger alerts for the following events: Asian Session Liquidity Mark the Asian Session High and Low. Trigger an alert when price sweeps the Asian Session High or Low. Allow the user to manually configure the Asian session time and
quero que verifique onde o ativo teve o menor valor de mercado, depois cada vez que o ativo estiver com o menor valor de mercado quero que você faça a compra de 0.3 do ativo EURUSD e faça a venda quando atinger o maior valor com base nos ultimos 366 dias

Información sobre el proyecto

Presupuesto
30+ USD
Plazo límite de ejecución
de 1 a 39 día(s)