MyFirstEA

Termos de Referência

//+------------------------------------------------------------------+
//|                                                     MyFirstEA.mq5 |
//+------------------------------------------------------------------+
#property copyright "Me"
#property version   "1.00"
#property strict

#include <Trade\Trade.mqh>

//--- Inputs
input double InpLots        = 0.10;   // Lot size
input int    InpFastMA      = 10;     // Fast MA period
input int    InpSlowMA      = 30;     // Slow MA period
input int    InpStopLoss    = 300;    // Stop loss (points)
input int    InpTakeProfit  = 600;    // Take profit (points)
input int    InpMagic       = 12345;  // Magic number (identifies this EA's trades)

CTrade  trade;
int     hFast, hSlow;
datetime lastBarTime = 0;

//+------------------------------------------------------------------+
int OnInit()
{
   trade.SetExpertMagicNumber(InpMagic);

   hFast = iMA(_Symbol, PERIOD_CURRENT, InpFastMA, 0, MODE_EMA, PRICE_CLOSE);
   hSlow = iMA(_Symbol, PERIOD_CURRENT, InpSlowMA, 0, MODE_EMA, PRICE_CLOSE);

   if(hFast == INVALID_HANDLE || hSlow == INVALID_HANDLE)
   {
      Print("Failed to create MA handles");
      return(INIT_FAILED);
   }
   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   if(hFast != INVALID_HANDLE) IndicatorRelease(hFast);
   if(hSlow != INVALID_HANDLE) IndicatorRelease(hSlow);
}

//+------------------------------------------------------------------+
//| Returns true if we already have an open position for this EA     |
//+------------------------------------------------------------------+
bool HasOpenPosition()
{
   for(int i = PositionsTotal() - 1; i >= 0; i--)
   {
      ulong ticket = PositionGetTicket(i);
      if(ticket == 0) continue;
      if(PositionGetString(POSITION_SYMBOL) == _Symbol &&
         PositionGetInteger(POSITION_MAGIC)   == InpMagic)
         return(true);
   }
   return(false);
}

//+------------------------------------------------------------------+
void OnTick()
{
   // Only act once per bar — avoids spamming trades on every tick
   datetime currentBar = iTime(_Symbol, PERIOD_CURRENT, 0);
   if(currentBar == lastBarTime) return;
   lastBarTime = currentBar;

   // Read the two most recent completed values of each MA
   double fast[3], slow[3];
   if(CopyBuffer(hFast, 0, 0, 3, fast) < 3) return;
   if(CopyBuffer(hSlow, 0, 0, 3, slow) < 3) return;

   double point = _Point;
   int    digits = (int)SymbolInfoInteger(_Symbol, SYMBOL_DIGITS);

   // Crossover using bar 1 (last closed) vs bar 2 (the one before)
   bool crossUp   = (fast[2] < slow[2] && fast[1] > slow[1]);
   bool crossDown = (fast[2] > slow[2] && fast[1] < slow[1]);

   if(HasOpenPosition()) return;

   if(crossUp)
   {
      double ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
      double sl  = NormalizeDouble(ask - InpStopLoss   * point, digits);
      double tp  = NormalizeDouble(ask + InpTakeProfit * point, digits);
      trade.Buy(InpLots, _Symbol, ask, sl, tp, "EA long");
   }
   else if(crossDown)
   {
      double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);
      double sl  = NormalizeDouble(bid + InpStopLoss   * point, digits);
      double tp  = NormalizeDouble(bid - InpTakeProfit * point, digits);
      trade.Sell(InpLots, _Symbol, bid, sl, tp, "EA short");
   }
}

Respondido

1
Desenvolvedor 1
Classificação
(22)
Projetos
28
7%
Arbitragem
9
33% / 33%
Expirado
1
4%
Trabalhando
2
Desenvolvedor 2
Classificação
(61)
Projetos
61
51%
Arbitragem
1
0% / 100%
Expirado
1
2%
Livre
3
Desenvolvedor 3
Classificação
(111)
Projetos
184
25%
Arbitragem
25
16% / 76%
Expirado
16
9%
Livre
4
Desenvolvedor 4
Classificação
(408)
Projetos
527
24%
Arbitragem
62
58% / 24%
Expirado
60
11%
Trabalhando
5
Desenvolvedor 5
Classificação
(10)
Projetos
13
77%
Arbitragem
0
Expirado
0
Livre
Publicou: 1 artigo, 2 códigos
6
Desenvolvedor 6
Classificação
(2)
Projetos
2
50%
Arbitragem
0
Expirado
0
Livre
Publicou: 7 códigos
7
Desenvolvedor 7
Classificação
(30)
Projetos
37
38%
Arbitragem
0
Expirado
2
5%
Trabalhando
Publicou: 1 código
8
Desenvolvedor 8
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
9
Desenvolvedor 9
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 3 códigos
10
Desenvolvedor 10
Classificação
(9)
Projetos
22
9%
Arbitragem
3
0% / 67%
Expirado
3
14%
Trabalhando
11
Desenvolvedor 11
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 2 códigos
12
Desenvolvedor 12
Classificação
(1)
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 5 códigos
13
Desenvolvedor 13
Classificação
(1)
Projetos
1
100%
Arbitragem
0
Expirado
0
Livre
14
Desenvolvedor 14
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
15
Desenvolvedor 15
Classificação
(1)
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 4 códigos
16
Desenvolvedor 16
Classificação
(60)
Projetos
96
43%
Arbitragem
4
0% / 100%
Expirado
4
4%
Livre
17
Desenvolvedor 17
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
18
Desenvolvedor 18
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 1 código
19
Desenvolvedor 19
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
20
Desenvolvedor 20
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
21
Desenvolvedor 21
Classificação
(2)
Projetos
2
0%
Arbitragem
1
0% / 100%
Expirado
0
Livre
22
Desenvolvedor 22
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
23
Desenvolvedor 23
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
24
Desenvolvedor 24
Classificação
(2)
Projetos
2
0%
Arbitragem
0
Expirado
0
Livre
25
Desenvolvedor 25
Classificação
Projetos
0
0%
Arbitragem
0
Expirado
0
Livre
Publicou: 10 códigos
Pedidos semelhantes
Hello, looking for a profitable long term bot to use on real live capital. No martingale allowed. Willing to also give % base ofnprofits for performing fees. Backtest is a must with real ticks
I NEED A PROFITABLE FOREX /FUTURES TRADING ROBOT. A VERY SIMPLE PROFITABLE TRADING ROBOT WITH 3 TECHNICAL CHECKS [AN MQL5 FOREX/FUTURES BOT] . THAT I CAN BOTH USED ON MY PRIVATE LIVE ACCOUNT AND PROP FIRM CHALLENGE ACCOUNT. THE STRATEGIES / LOGIC AND THE ALGORITHM CAN BE ANY PRICE ACTION BOT, IT CAN ANY PRICE ACTION COMBINED WITH ANY INDICATOR TO FILTER THE TREND OR TO GIVE ME THE TREND. THESE ARE MUST HALF
Seeking an Established and Profitable Gold Scalping System – MT5 I am a serious buyer looking to acquire an existing, fully operational Expert Advisor specifically designed for scalping XAUUSD (Gold) on MetaTrader 5. I am particularly interested in experienced developers and quantitative traders who have developed successful proprietary trading systems, including systems that are not publicly available on the MQL5
I am looking for the original developer from Egypt who sent me the MJ v3.01 Gold EA (mj.ex5) on December 2, 2026, with a 10-day demo trial. You were Developer #28 in my previous Freelance job and offered the EA for $200. Unfortunately, I lost access to our previous conversation and would like to reconnect with you. I am still interested in your EA and would like to complete the testing, discuss the settings, and
EA 30+ USD
Build an MT5 Expert Advisor using MQL5. I want an automated trading bot for Exness MT5. Markets: XAUUSD (Gold) BTCUSD (Bitcoin), subject to the broker's actual symbol name. Trading strategy: H1 timeframe for trend direction. M15 timeframe for trade entries. EMA 20 and EMA 50 for trend identification. Only buy when the confirmed trend is bullish. Only sell when the confirmed trend is bearish. Use candle-close
Gulu 30+ USD
create money on forex ensuring nothing but profit basically also crypto an d ensure you use every means possible to ensure in turn a profit is made that what i want i want perfection
If you already have a working gold order-flow EA that matches the logic described here, I'm open to buying or licensing it instead of a custom build. Please provide: A demo version that I can run in the MT5 Strategy Tester (for example, a time-limited or demo-account-only build) A clear explanation of the trading logic: what triggers an entry, how the stop loss and take profit are set, and which order-flow or
I'm looking to purchase an already-developed, profitable trading bot specifically for Deriv. I'm not interested in building a new one from scratch. The bot must have a test version that I can try out, as well as verifiable historical live trading results demonstrating its profitability. I'm only interested in proven bots with a track record of real-market performance
I am looking to purchase an existing, fully developed and operational XAUUSD scalping Expert Advisor (EA) for MetaTrader 5. IMPORTANT: I am NOT looking for new development, custom programming, or an experimental strategy. I am only interested in an existing, ready-made and proven trading system. Requirements: Fully automated XAUUSD scalping EA for MT5. Short-duration trades with an active trading frequency. Hard Stop
The idea of the trading system is as follows : market entries are performed when MACD's main and signal lines intersect in the current trend direction . 2. Trend is determined based on the Exponential Moving Average with the specified period (InpMATrendPeriod). If the current EMA value is greater than the previous one, the trend is seen as growing (ema_current > ema_previous). Alternatively, if current EMA is

Informações sobre o projeto

Orçamento
30+ USD
Prazo
de 1 para 11 dias

Cliente

Pedidos postados1
Número de arbitragens0