Spécifications

//+------------------------------------------------------------------+
//| SimpleEA.mq5|
//| Copyright 2023, MetaQuotes Software Corp. |
//+------------------------------------------------------------------+
#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
Développeur 1
Évaluation
(31)
Projets
55
5%
Arbitrage
34
0% / 94%
En retard
24
44%
Travail
2
Développeur 2
Évaluation
(151)
Projets
232
32%
Arbitrage
18
39% / 33%
En retard
1
0%
Travail
3
Développeur 3
Évaluation
(539)
Projets
620
33%
Arbitrage
36
39% / 53%
En retard
11
2%
Chargé
4
Développeur 4
Évaluation
(94)
Projets
130
9%
Arbitrage
8
25% / 38%
En retard
28
22%
Travail
5
Développeur 5
Évaluation
(11)
Projets
17
59%
Arbitrage
2
0% / 100%
En retard
2
12%
Gratuit
6
Développeur 6
Évaluation
Projets
1
100%
Arbitrage
0
En retard
0
Gratuit
7
Développeur 7
Évaluation
(48)
Projets
49
8%
Arbitrage
0
En retard
0
Gratuit

Informations sur le projet

Budget
30+ USD
Délais
de 15 à 35 jour(s)