Termos de Referência
//+------------------------------------------------------------------+
//| 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);
}
}
//+------------------------------------------------------------------+
Respondido
1
Classificação
Projetos
60
22%
Arbitragem
3
33%
/
33%
Expirado
15
25%
Livre
2
Classificação
Projetos
651
33%
Arbitragem
41
41%
/
46%
Expirado
11
2%
Ocupado
3
Classificação
Projetos
701
34%
Arbitragem
34
71%
/
9%
Expirado
22
3%
Livre
4
Classificação
Projetos
2
0%
Arbitragem
0
Expirado
1
50%
Livre
5
Classificação
Projetos
24
21%
Arbitragem
0
Expirado
2
8%
Livre
6
Classificação
Projetos
39
23%
Arbitragem
14
0%
/
93%
Expirado
4
10%
Livre
7
Classificação
Projetos
1
0%
Arbitragem
2
0%
/
50%
Expirado
0
Livre
8
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
9
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
10
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
11
Classificação
Projetos
50
8%
Arbitragem
0
Expirado
0
Livre
12
Classificação
Projetos
0
0%
Arbitragem
5
0%
/
80%
Expirado
0
Livre
13
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
14
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
15
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
16
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
17
Classificação
Projetos
8
0%
Arbitragem
8
13%
/
88%
Expirado
0
Livre
18
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
19
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
20
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
21
Classificação
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 1 código
Pedidos semelhantes
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
Informações sobre o projeto
Orçamento
30+ USD
Prazo
de 1 para 39 dias