GoldTraderTs.mql5

MQL5 Asesores Expertos

Tarea técnica

#include <Trade/Trade.mqh>
CTrade trade;
//+------------------------------------------------------------------+
//| Gold Auto Trader EA with Trailing Stop                          |
//+------------------------------------------------------------------+
#property strict
#include <Trade/Trade.mqh>
CTrade trade;

// إعدادات الدخول
input double BuyZoneLow   = 3678.0;
input double BuyZoneHigh  = 3680.0;
input double SellZoneLow  = 3695.0;
input double SellZoneHigh = 3700.0;

// إعدادات الصفقة
input double LotSize      = 0.10;   // حجم العقد
input double StopLoss     = 10;     // وقف الخسارة (بالدولار)
input double TakeProfit   = 20;     // الهدف (بالدولار)
input double TrailingStop = 5;      // وقف خسارة متحرك (بالدولار)

//+------------------------------------------------------------------+
void OnTick()
{
   double price = SymbolInfoDouble(_Symbol, SYMBOL_BID);

   // فتح صفقات جديدة إذا لا توجد صفقات مفتوحة
   if(PositionsTotal() == 0)
   {
      // 🚀 شراء
      if(price >= BuyZoneLow && price <= BuyZoneHigh)
      {
         double sl = price - StopLoss;
         double tp = price + TakeProfit;
         trade.Buy(LotSize, _Symbol, price, sl, tp, "Buy Gold");
      }

      // 📉 بيع
      if(price >= SellZoneLow && price <= SellZoneHigh)
      {
         double sl = price + StopLoss;
         double tp = price - TakeProfit;
         trade.Sell(LotSize, _Symbol, price, sl, tp, "Sell Gold");
      }
   }

   // تطبيق Trailing Stop على الصفقات المفتوحة
   for(int i=0; i<PositionsTotal(); i++)
   {
      string symbol = PositionGetSymbol(i);
      if(PositionSelect(symbol))
      {
         long type     = PositionGetInteger(POSITION_TYPE);
         double open   = PositionGetDouble(POSITION_PRICE_OPEN);
         double sl     = PositionGetDouble(POSITION_SL);
         double priceB = SymbolInfoDouble(symbol, SYMBOL_BID);
         double priceA = SymbolInfoDouble(symbol, SYMBOL_ASK);

         // للشراء
         if(type == POSITION_TYPE_BUY)
         {
            double newSL = priceB - TrailingStop;
            if(newSL > sl && priceB - open >= TrailingStop)
               trade.PositionModify(symbol, newSL, PositionGetDouble(POSITION_TP));
         }

         // للبيع
         if(type == POSITION_TYPE_SELL)
         {
            double newSL = priceA + TrailingStop;
            if((sl == 0 || newSL < sl) && open - priceA >= TrailingStop)
               trade.PositionModify(symbol, newSL, PositionGetDouble(POSITION_TP));
         }
      }
   }
}

Han respondido

1
Desarrollador 1
Evaluación
(51)
Proyectos
74
20%
Arbitraje
12
17% / 25%
Caducado
7
9%
Trabaja
2
Desarrollador 2
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
3
Desarrollador 3
Evaluación
(1)
Proyectos
2
0%
Arbitraje
1
0% / 0%
Caducado
0
Libre
4
Desarrollador 4
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Trabaja
5
Desarrollador 5
Evaluación
(6)
Proyectos
6
17%
Arbitraje
0
Caducado
2
33%
Trabaja
6
Desarrollador 6
Evaluación
(1)
Proyectos
0
0%
Arbitraje
2
0% / 0%
Caducado
0
Trabaja
7
Desarrollador 7
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
8
Desarrollador 8
Evaluación
(9)
Proyectos
18
39%
Arbitraje
1
0% / 100%
Caducado
3
17%
Trabaja
9
Desarrollador 9
Evaluación
Proyectos
0
0%
Arbitraje
1
0% / 0%
Caducado
0
Libre
10
Desarrollador 10
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
11
Desarrollador 11
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Trabajando
12
Desarrollador 12
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
I need a robot that combines several custom indicators I designed, used on two higher timeframes for market analysis, with entries on the 1-minute timeframe. It requires intelligent Martingale and Hedge money management. I need someone with sufficient expertise in hedging and Martingale. This strategy is very detailed, but I firmly believe it will definitely be profitable
Hello Developer I need a custom breakout + retest scoring system in TrendSpider . Breakout: valid if candle closes ≥ 0.4 × ATR20 above the line (lookback 8 bars, daily/weekly). Retest: valid within 20 bars if price low is within ±0.2 × ATR20 of the line → must trigger an alert. Scoring: add points for RVOL ≥ 1.3, SMA50 strong close, RSI 54–71, channel breakout, retest & hold, ATR expansion, undervaluation, SMA50
Hello! I'm looking to hire a developer to create a custom trading bot for MetaTrader 5 (MT5) that automates hedged trading across two separate MT5 accounts (e.g., one for a prop firm and one for a broker). The bot should open opposite positions simultaneously on both accounts, with customizable parameters for lot sizes, stop-loss (SL), and take-profit (TP). It needs to support both market orders and pending orders
Looking to develop an effective bot for Boom Index - effective and accurate bot Tight spreads, Broker is Deriv. It should be timely and accruate and timely. will test it live
I scalp XAU (gold) in 1 min chart. Into the chart I have placed 3 emas: 9, 20 and 50 and they follow the 5-min chart. When trading I have market order window in MT5 open and I´m ready to hit the button at anytime price action tells me. There are a major problem setting SL and TP: - I can only set fixed price in SL and TP. Price moves very quickly so I´m constantly behind. For example let say I want to buy gold at
Develop an Expert Advisor trading trend reversals. Reversal signals will be generated based on Price Action patterns. Trend will be determined based on ADX, Alligator and MACD, while the indicator selection should be available in the EA's input parameters
TradeCopier 30 - 40 USD
Hello! I'm looking to hire a developer to create a custom trading bot for MetaTrader 5 (MT5) that automates hedged trading across two separate MT5 accounts (e.g., one for a prop firm and one for a broker). The bot should open opposite positions simultaneously on both accounts, with customizable parameters for lot sizes, stop-loss (SL), and take-profit (TP). It needs to support both market orders and pending orders
Small modification in pinescript, adding inputs like starting time for counting indicator 1 cycle and end ime for counting indicator 1 cycle and create based on this indicator Simple EA. I want to backtest this strategy on historical data. My budget is 30 USD and I think it's very fair price
I need experience EA programmer to fix my existing one EA. Job Description for EA Bug Fixing (MetaTrader 5) Title: Fix Bugs in Existing MT5 Expert Advisor (Simple EMA Strategy) Platform: MetaTrader 5 (MQL5) Type: Bug fixing & optimization or fixing program
Here's a detailed description of three independent Expert Advisors (EAs), each based on a different strategy: EA 1: Trend Following Strategy Strategy Overview The EA will implement a trend following strategy, identifying trending markets and riding the trend. Key Features 1. *Trend Identification*: The EA will use technical indicators to identify trending markets, such as: - Moving Averages (MA) - Average

Información sobre el proyecto

Presupuesto
30+ USD
IVA (19%): 5.7 USD
Total: 36 USD
Para el ejecutor
27 USD

Cliente

Encargos realizados1
Número de arbitrajes0