İş Gereklilikleri
//+------------------------------------------------------------------+
//| 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);
}
}
//+------------------------------------------------------------------+
Yanıtlandı
1
Derecelendirme
Projeler
60
22%
Arabuluculuk
3
33%
/
33%
Süresi dolmuş
15
25%
Serbest
2
Derecelendirme
Projeler
630
33%
Arabuluculuk
38
39%
/
50%
Süresi dolmuş
11
2%
Çalışıyor
3
Derecelendirme
Projeler
696
34%
Arabuluculuk
34
68%
/
9%
Süresi dolmuş
22
3%
Çalışıyor
4
Derecelendirme
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
1
50%
Serbest
5
Derecelendirme
Projeler
24
21%
Arabuluculuk
0
Süresi dolmuş
2
8%
Serbest
6
Derecelendirme
Projeler
39
23%
Arabuluculuk
14
0%
/
93%
Süresi dolmuş
4
10%
Çalışıyor
Proje bilgisi
Bütçe
30+ USD
Son teslim tarihi
from 1 to 39 gün
Müşteri
Verilmiş siparişler1
Arabuluculuk sayısı0