Şartname

//+------------------------------------------------------------------+
//|                     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
61
23%
Arabuluculuk
4
50% / 25%
Süresi dolmuş
15
25%
Serbest
2
Geliştirici 2
Derecelendirme
(606)
Projeler
703
33%
Arabuluculuk
43
47% / 44%
Süresi dolmuş
13
2%
Meşgul
3
Geliştirici 3
Derecelendirme
(454)
Projeler
718
34%
Arabuluculuk
35
69% / 9%
Süresi dolmuş
22
3%
Çalışıyor
4
Geliştirici 4
Derecelendirme
(2)
Projeler
3
0%
Arabuluculuk
0
Süresi dolmuş
2
67%
Serbest
5
Geliştirici 5
Derecelendirme
(27)
Projeler
33
36%
Arabuluculuk
0
Süresi dolmuş
2
6%
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
(50)
Projeler
51
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
(2)
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 1 kod
Benzer siparişler
TENHO UM INDICADOR E EU QUERO QUE TRANSFORME ELE EM ROBÔ OU O ROBÔ FAÇA ENTRADAS COM ELE USANDO OS SINAIS DO INDICADOR. MEU NÚMERO 21969476161 SÓ CHAMAR QUE FALO DETALHADAMENTE
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

Proje bilgisi

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