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
54
6%
Arbitrage
25
0%
/
96%
En retard
24
44%
Travail
2
Évaluation
Projets
214
31%
Arbitrage
16
44%
/
25%
En retard
0
Travail
3
Évaluation
Projets
613
34%
Arbitrage
32
41%
/
47%
En retard
9
1%
Occupé
4
Évaluation
Projets
116
7%
Arbitrage
8
25%
/
38%
En retard
27
23%
Gratuit
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
45
9%
Arbitrage
0
En retard
0
Gratuit
Commandes similaires
Robo Abre e Fecha
30 - 3000 USD
Olá, preciso de um robo que abra e feche ordens, utilizando martingale. Preciso que este desenvolvedor seja muito experiente, pois, será duas ordens simultâneas, uma de compra e uma de venda, aplicando martingale, com distancias, preço pré estabelecido
Informations sur le projet
Budget
30+ USD
Pour le développeur
27
USD
Délais
de 15 à 35 jour(s)