İş 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
Geliştirici 1
Derecelendirme
(35)
Projeler
60
22%
Arabuluculuk
3
33% / 33%
Süresi dolmuş
15
25%
Serbest
2
Geliştirici 2
Derecelendirme
(563)
Projeler
651
33%
Arabuluculuk
41
41% / 46%
Süresi dolmuş
11
2%
Meşgul
3
Geliştirici 3
Derecelendirme
(444)
Projeler
701
34%
Arabuluculuk
34
71% / 9%
Süresi dolmuş
22
3%
Serbest
4
Geliştirici 4
Derecelendirme
(1)
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
1
50%
Serbest
5
Geliştirici 5
Derecelendirme
(19)
Projeler
24
21%
Arabuluculuk
0
Süresi dolmuş
2
8%
Serbest
6
Geliştirici 6
Derecelendirme
(28)
Projeler
39
23%
Arabuluculuk
14
0% / 93%
Süresi dolmuş
4
10%
Serbest
7
Geliştirici 7
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
2
0% / 50%
Süresi dolmuş
0
Serbest
8
Geliştirici 8
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
9
Geliştirici 9
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
10
Geliştirici 10
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
11
Geliştirici 11
Derecelendirme
(49)
Projeler
50
8%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
12
Geliştirici 12
Derecelendirme
(1)
Projeler
0
0%
Arabuluculuk
5
0% / 80%
Süresi dolmuş
0
Serbest
13
Geliştirici 13
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
14
Geliştirici 14
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
15
Geliştirici 15
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
16
Geliştirici 16
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
17
Geliştirici 17
Derecelendirme
(6)
Projeler
8
0%
Arabuluculuk
8
13% / 88%
Süresi dolmuş
0
Serbest
18
Geliştirici 18
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
19
Geliştirici 19
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
20
Geliştirici 20
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
21
Geliştirici 21
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 1 kod
Benzer siparişler
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

Proje bilgisi

Bütçe
30+ USD
Son teslim tarihi
from 1 to 39 gün