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
Evaluación
Proyectos
60
22%
Arbitraje
3
33%
/
33%
Caducado
15
25%
Libre
2
Evaluación
Proyectos
630
33%
Arbitraje
38
39%
/
50%
Caducado
11
2%
Trabaja
3
Evaluación
Proyectos
696
34%
Arbitraje
34
68%
/
9%
Caducado
22
3%
Trabaja
4
Evaluación
Proyectos
2
0%
Arbitraje
0
Caducado
1
50%
Libre
5
Evaluación
Proyectos
24
21%
Arbitraje
0
Caducado
2
8%
Libre
6
Evaluación
Proyectos
39
23%
Arbitraje
14
0%
/
93%
Caducado
4
10%
Trabaja
Solicitudes similares
Canal 4 candles
30 - 50 USD
Preciso de uma EA 12. 981 169843.. me chamem! Mt5. Estratégia muito simples apenas com candles e canal. Stop gain stop loss, e martingale!!! Filtro de horario, maximo de gain no dia e maximo de loss no dia
Información sobre el proyecto
Presupuesto
30+ USD
Plazo límite de ejecución
de 1 a 39 día(s)
Cliente
Encargos realizados1
Número de arbitrajes0