Spécifications
//+------------------------------------------------------------------+
//| 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);
}
}
}
//+------------------------------------------------------------------+
Répondu
1
Évaluation
Projets
53
6%
Arbitrage
21
0%
/
100%
En retard
24
45%
Chargé
2
Évaluation
Projets
171
33%
Arbitrage
12
25%
/
33%
En retard
0
Travail
3
Évaluation
Projets
557
33%
Arbitrage
27
44%
/
44%
En retard
8
1%
Occupé
4
Évaluation
Projets
114
7%
Arbitrage
8
25%
/
38%
En retard
27
24%
Travail
5
Évaluation
Projets
17
59%
Arbitrage
2
0%
/
100%
En retard
2
12%
Gratuit
6
Évaluation
Projets
1
100%
Arbitrage
0
En retard
0
Gratuit
7
Évaluation
Projets
40
10%
Arbitrage
0
En retard
0
Gratuit
Informations sur le projet
Budget
30+ USD
Pour le développeur
27
USD
Délais
de 15 à 35 jour(s)