Termos de Referência
//+------------------------------------------------------------------+
//| SimpleEA.mq5|
//| Copyright 2023, MetaQuotes Software Corp. |
//| https://www.mql5.com|
//+------------------------------------------------------------------+
#property copyright "2023, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
input int FastMAPeriod = 12; // Período da média móvel rápida
input int SlowMAPeriod = 26; // Período da média móvel lenta
input double LotSize = 0.1; // Tamanho do lote
double FastMA, SlowMA;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- initialization of indicators
FastMA = iMA(NULL, 0, FastMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
SlowMA = iMA(NULL, 0, SlowMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
FastMA = iMA(NULL, 0, FastMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
SlowMA = iMA(NULL, 0, SlowMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
double previousFastMA = iMA(NULL, 0, FastMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
double previousSlowMA = iMA(NULL, 0, SlowMAPeriod, 0, MODE_SMA, PRICE_CLOSE, 1);
if (previousFastMA < previousSlowMA && FastMA > SlowMA)
{
if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES) == false)
{
OrderSend(Symbol(), OP_BUY, LotSize, Ask, 2, 0, 0, "Buy Order", 0, 0, clrGreen);
}
}
}
//+------------------------------------------------------------------+
Respondido
1
Classificação
Projetos
55
5%
Arbitragem
35
0%
/
94%
Expirado
24
44%
Trabalhando
2
Classificação
Projetos
238
33%
Arbitragem
20
45%
/
30%
Expirado
2
1%
Livre
3
Classificação
Projetos
657
32%
Arbitragem
41
41%
/
46%
Expirado
11
2%
Ocupado
4
Classificação
Projetos
130
9%
Arbitragem
8
25%
/
38%
Expirado
28
22%
Trabalhando
5
Classificação
Projetos
17
59%
Arbitragem
2
0%
/
100%
Expirado
2
12%
Livre
6
Classificação
Projetos
1
100%
Arbitragem
0
Expirado
0
Livre
7
Classificação
Projetos
50
8%
Arbitragem
0
Expirado
0
Livre
Informações sobre o projeto
Orçamento
30+ USD
Prazo
de 15 para 35 dias