Ş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
Derecelendirme
Projeler
61
23%
Arabuluculuk
4
50%
/
25%
Süresi dolmuş
15
25%
Serbest
2
Derecelendirme
Projeler
703
33%
Arabuluculuk
43
47%
/
44%
Süresi dolmuş
13
2%
Meşgul
3
Derecelendirme
Projeler
718
34%
Arabuluculuk
35
69%
/
9%
Süresi dolmuş
22
3%
Çalışıyor
4
Derecelendirme
Projeler
3
0%
Arabuluculuk
0
Süresi dolmuş
2
67%
Serbest
5
Derecelendirme
Projeler
33
36%
Arabuluculuk
0
Süresi dolmuş
2
6%
Serbest
6
Derecelendirme
Projeler
39
23%
Arabuluculuk
14
0%
/
93%
Süresi dolmuş
4
10%
Serbest
7
Derecelendirme
Projeler
1
0%
Arabuluculuk
2
0%
/
50%
Süresi dolmuş
0
Serbest
8
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
9
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
10
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
11
Derecelendirme
Projeler
51
8%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
12
Derecelendirme
Projeler
0
0%
Arabuluculuk
5
0%
/
80%
Süresi dolmuş
0
Serbest
13
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
14
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
15
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
16
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
17
Derecelendirme
Projeler
8
0%
Arabuluculuk
8
13%
/
88%
Süresi dolmuş
0
Serbest
18
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
19
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
20
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
21
Derecelendirme
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 1 kod
Benzer siparişler
PRECISO DE PROGRAMADOS BRABOS
30 - 75 USD
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
Preciso de uma ia baseado nisso
30 - 50 USD
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