Spécifications
//+------------------------------------------------------------------+
//| Gold_Breakout_Ultimate_EA.mq5 |
//| الإصدار النهائي - خالي من أيقونة |
//+------------------------------------------------------------------+
#property copyright "Elite Trader"
#property version "1.13"
#property strict
// تم حذف سطر #property icon عمداً لتجنب خطأ الملف المفقود
#include <Trade/Trade.mqh>
// ==================== إعدادات المدخلات ====================
input double InpRiskPercent = 1.5; // نسبة المخاطرة من الرصيد (%)
input double InpFixedLots = 0.0; // حجم عقد ثابت (0 = استخدام النسبة)
input int InpBreakoutBars = 20; // عدد الشموع لتحديد المنطقة
input double InpBufferPercent = 0.15; // هامش التمويه (لتقليل الإشارات الخادعة)
input int InpRSIPeriod = 14; // فترة مؤشر RSI
input int InpMAPeriod = 200; // المتوسط المتحرك للاتجاه العام
input double InpATRFilter = 0.4; // نسبة ATR للفلتر (0 = إلغاء)
input double InpTakeProfitRatio = 2.0; // مضاعف وقف الخسارة للهدف الأول
input double InpPartialPercent = 50.0; // نسبة الإغلاق الجزئي عند الهدف الأول (%)
input double InpTrailingATR = 1.8; // تفعيل التريلنج بعد هذا المضاعف من ATR
input bool InpUseTimeFilter = true; // تفعيل فلتر تجنب أوقات الأخبار
input int InpCooldownBars = 3; // عدد الشموع للانتظار بعد الصفقة الخاسرة
// ==================== المتغيرات العامة ====================
double Resistance_Level, Support_Level;
double ATR_Value, MA_Value, RSI_Value;
datetime lastBarTime;
int ATR_Handle, RSI_Handle, MA_Handle;
bool isBuyCooldown = false, isSellCooldown = false;
int barsAfterLoss = 0;
double lastTradeResult = 0;
CTrade trade;
//+------------------------------------------------------------------+
//| دالة التهيئة |
//+------------------------------------------------------------------+
int OnInit()
{
ATR_Handle = iATR(_Symbol, _Period, 14);
RSI_Handle = iRSI(_Symbol, _Period, InpRSIPeriod, PRICE_CLOSE);
MA_Handle = iMA(_Symbol, _Period, InpMAPeriod, 0, MODE_SMA, PRICE_CLOSE);
if(ATR_Handle == INVALID_HANDLE || RSI_Handle == INVALID_HANDLE || MA_Handle == INVALID_HANDLE)
{
Print("خطأ في تهيئة المؤشرات");
return(INIT_FAILED);
}
lastBarTime = iTime(_Symbol, _Period, 0);
Print("✅ روبوت الذهب جاهز على ", _Symbol);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| دالة التحديث لكل شمعة جديدة |
//+------------------------------------------------------------------+
void OnTick()
{
if(lastBarTime == iTime(_Symbol, _Period, 0))
return;
lastBarTime = iTime(_Symbol, _Period, 0);
UpdateIndicators();
CalculateZones();
DrawZones();
ManageOpenPositions();
CheckForEntry();
}
//+------------------------------------------------------------------+
//| تحديث قيم المؤشرات |
//+------------------------------------------------------------------+
void UpdateIndicators()
{
double atr_arr[1], rsi_arr[1], ma_arr[1];
CopyBuffer(ATR_Handle, 0, 0, 1, atr_arr);
CopyBuffer(RSI_Handle, 0, 0, 1, rsi_arr);
CopyBuffer(MA_Handle, 0, 0, 1, ma_arr);
ATR_Value = atr_arr[0];
RSI_Value = rsi_arr[0];
MA_Value = ma_arr[0];
if(ATR_Value == 0) ATR_Value = 0.1; // حماية
}
//+------------------------------------------------------------------+
//| حساب مناطق الدعم والمقاومة |
//+------------------------------------------------------------------+
void CalculateZones()
{
int start = 1;
double high = iHigh(_Symbol, _Period, iHighest(_Symbol, _Period, MODE_HIGH, InpBreakoutBars, start));
double low = iLow(_Symbol, _Period, iLowest(_Symbol, _Period, MODE_LOW, InpBreakoutBars, start));
double buffer = (high - low) * (InpBufferPercent / 100);
Resistance_Level = high + buffer;
Support_Level = low - buffer;
}
//+------------------------------------------------------------------+
//| رسم الخطوط على الشارت |
//+------------------------------------------------------------------+
void DrawZones()
{
ObjectCreate(0, "UBS_Res", OBJ_HLINE, 0, 0, Resistance_Level);
ObjectSetInteger(0, "UBS_Res", OBJPROP_COLOR, clrRed);
ObjectCreate(0, "UBS_Supp", OBJ_HLINE, 0, 0, Support_Level);
ObjectSetInteger(0, "UBS_Supp", OBJPROP_COLOR, clrGreen);
}
//+------------------------------------------------------------------+
//| منطق الدخول (مع فلاتر الخبرة والـ ATR) |
//+------------------------------------------------------------------+
void CheckForEntry()
{
if(InpUseTimeFilter && IsNewsTime())
return;
double close_cur = iClose(_Symbol, _Period, 0);
double close_prev = iClose(_Symbol, _Period, 1);
double open_cur = iOpen(_Symbol, _Period, 0);
if(InpATRFilter > 0)
{
double range = MathAbs(close_cur - open_cur);
if(range < (ATR_Value * InpATRFilter)) return;
}
// شراء
if(!isBuyCooldown && close_prev <= Resistance_Level && close_cur > Resistance_Level && RSI_Value > 50)
{
if(!IsPositionExist(POSITION_TYPE_BUY))
{
double sl = Support_Level - (ATR_Value * 0.5);
double tp = close_cur + ( (close_cur - sl) * InpTakeProfitRatio );
OpenOrder(ORDER_TYPE_BUY, sl, tp);
Print("🟢 شراء عند الاختراق");
}
}
// بيع
if(!isSellCooldown && close_prev >= Support_Level && close_cur < Support_Level && RSI_Value < 50)
{
if(!IsPositionExist(POSITION_TYPE_SELL))
{
double sl = Resistance_Level + (ATR_Value * 0.5);
double tp = close_cur - ( (sl - close_cur) * InpTakeProfitRatio );
OpenOrder(ORDER_TYPE_SELL, sl, tp);
Print("🔴 بيع عند الكسر");
}
}
}
//+------------------------------------------------------------------+
//| إدارة الصفقات (الإغلاق الجزئي والتريلنج) |
//+------------------------------------------------------------------+
void ManageOpenPositions()
{
for(int i = PositionsTotal() - 1; i >= 0; i--)
{
ulong ticket = PositionGetTicket(i);
if(PositionSelectByTicket(ticket))
{
if(PositionGetString(POSITION_SYMBOL) != _Symbol) continue;
double openPrice = PositionGetDouble(POSITION_PRICE_OPEN);
double currentSL = PositionGetDouble(POSITION_SL);
double currentTP = PositionGetDouble(POSITION_TP);
ENUM_POSITION_TYPE type = (ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE);
double distance = 0;
if(type == POSITION_TYPE_BUY)
distance = (SymbolInfoDouble(_Symbol, SYMBOL_BID) - openPrice) / ATR_Value;
else
distance = (openPrice - SymbolInfoDouble(_Symbol, SYMBOL_ASK)) / ATR_Value;
// إغلاق جزئي عند الهدف الأول
if(distance >= (InpTakeProfitRatio * 0.75) && currentTP == 0)
{
if(InpPartialPercent > 0)
{
double lots = PositionGetDouble(POSITION_VOLUME);
double closeLots = lots * (InpPartialPercent / 100);
if(closeLots > 0.01)
{
trade.PositionClosePartial(ticket, NormalizeLots(closeLots));
}
}
trade.PositionModify(ticket, openPrice, 0);
}
// تفعيل التريلنج
if(distance >= InpTrailingATR)
{
double newSL = 0;
if(type == POSITION_TYPE_BUY)
newSL = SymbolInfoDouble(_Symbol, SYMBOL_BID) - (ATR_Value * 0.8);
else
newSL = SymbolInfoDouble(_Symbol, SYMBOL_ASK) + (ATR_Value * 0.8);
if((type == POSITION_TYPE_BUY && newSL > currentSL) ||
(type == POSITION_TYPE_SELL && newSL < currentSL))
{
trade.PositionModify(ticket, newSL, currentTP);
}
}
}
}
}
//+------------------------------------------------------------------+
//| تنفيذ الأمر |
//+------------------------------------------------------------------+
void OpenOrder(ENUM_ORDER_TYPE type, double sl_price, double tp_price)
{
double lots = InpFixedLots;
if(lots == 0)
{
double riskMoney = AccountInfoDouble(ACCOUNT_BALANCE) * (InpRiskPercent / 100);
double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
double price = (type == ORDER_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID);
double slPoints = MathAbs(sl_price - price) / _Point;
double riskPerLot = slPoints * tickValue * (tickSize / _Point);
if(riskPerLot > 0) lots = riskMoney / riskPerLot;
lots = NormalizeLots(lots);
}
double price = (type == ORDER_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID);
trade.PositionOpen(_Symbol, type, lots, price, sl_price, tp_price, "Gold EA");
}
//+------------------------------------------------------------------+
//| دوال مساعدة |
//+------------------------------------------------------------------+
bool IsPositionExist(ENUM_POSITION_TYPE type)
{
for(int i = PositionsTotal() - 1; i >= 0; i--)
{
if(PositionSelectByTicket(PositionGetTicket(i)))
if(PositionGetString(POSITION_SYMBOL) == _Symbol && PositionGetInteger(POSITION_TYPE) == type)
return true;
}
return false;
}
double NormalizeLots(double lots)
{
double step = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
if(step == 0) step = 0.01;
double normalized = MathRound(lots / step) * step;
normalized = NormalizeDouble(normalized, 2);
if(normalized < SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN)) normalized = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
if(normalized > SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX)) normalized = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);
return normalized;
}
بول إز نيوزتايم()
{
datetime now = TimeCurrent();
MqlDateTime dt;
TimeToStruct (الآن، dt);
// تجنب التداول من 13:30 إلى 15:30 بتوقيت السيرفر
إذا (dt.hour == 13 && dt.min >= 30) أعاد true;
إذا (dt.hour == 14) أعاد true;
إذا (dt.hour == 15 && dt.min < 30) أعد true;
العودة خاطئة؛
}
//+------------------------------------------------------------------+
//| دالة التدمير (تنظيف) |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
إذا(ATR_Handle != INVALID_HANDLE) IndicatorRelease(ATR_Handle);
إذا(RSI_Handle != INVALID_HANDLE) IndicatorRelease(RSI_Handle);
if(MA_Handle != INVALID_HANDLE) IndicatorRelease(MA_Handle);
ObjectsDeleteAll (0, "UBS_");
Print(" 🛑 تم إيقاف الروبوت وتنظيف الشارت");
}
Répondu
1
Évaluation
Projets
22
18%
Arbitrage
8
38%
/
38%
En retard
3
14%
Travail
2
Évaluation
Projets
8
0%
Arbitrage
2
50%
/
0%
En retard
1
13%
Travail
3
Évaluation
Projets
1
0%
Arbitrage
0
En retard
0
Gratuit
4
Évaluation
Projets
20
45%
Arbitrage
6
33%
/
17%
En retard
2
10%
Chargé
Publié : 7 articles, 35 codes
5
Évaluation
Projets
511
23%
Arbitrage
60
57%
/
25%
En retard
60
12%
Travail
6
Évaluation
Projets
4
0%
Arbitrage
1
100%
/
0%
En retard
1
25%
Gratuit
7
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
8
Évaluation
Projets
1
0%
Arbitrage
0
En retard
0
Gratuit
9
Évaluation
Projets
8
63%
Arbitrage
0
En retard
0
Travail
10
Évaluation
Projets
1
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 1 code
11
Évaluation
Projets
3
33%
Arbitrage
0
En retard
0
Chargé
12
Évaluation
Projets
34
35%
Arbitrage
0
En retard
2
6%
Gratuit
13
Évaluation
Projets
1
0%
Arbitrage
0
En retard
0
Gratuit
14
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
15
Évaluation
Projets
95
32%
Arbitrage
9
22%
/
56%
En retard
5
5%
Travail
16
Évaluation
Projets
2
0%
Arbitrage
1
0%
/
100%
En retard
0
Gratuit
17
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 1 code
18
Évaluation
Projets
1
0%
Arbitrage
1
0%
/
100%
En retard
0
Travail
19
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
20
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Publié : 1 code
Commandes similaires
Looking for robot EA Builder For MT5
100 - 200 USD
I want to Build a EA Robot that combine from my trading style and any conditions we can discussion. My trading style information below. 1 Set Up , 1 Rule , 1 Trade , 1 Session , 1 Target
Ich möchte einen professionellen Expert Advisor (EA) für MetaTrader 5 entwickeln lassen, der sich funktional am ThunderGold Scalper orientiert. Instrument: XAUUSD / GOLD Zeitrahmen: M15 Plattform: MetaTrader 5 / MQL5 Der EA soll eine eigene, nachprogrammierte Strategie verwenden und keine geschützten Quellcodes oder proprietären Dateien des Originalprodukts kopieren. Gewünschte Funktionen: automatischer Handel auf
XAGUSD MT5 Automated Trading Expert Advisor
30 - 200 USD
I need a fully automated Expert Advisor (EA) written in MQL5 for MetaTrader 5. The EA must work directly inside MT5 and must NOT require TradingView, PineConnector, webhooks, or another external connector to place trades. Trading Instrument Primary symbol: XAGUSD (Silver) My broker may display the symbol as XAGUSD-ECN, so the EA should work with the broker’s available XAGUSD symbol. Main entry timeframe: 5-minute
RECHERCHE DÉVELOPPEUR MQL5 — PARTENARIAT 50/50 Objectif : développer un EA de trading automatisé en 11 jours maximum pour participer à plusieurs concours de trading démo. Je recherche un développeur MQL5 expérimenté, capable de développer, tester et optimiser un EA proprement, avec une vraie maîtrise de la gestion du risque. CONCOURS VISÉS 🥇 XM — Weekly Demo Contest - Concours récurrent - Prize pool annoncé : 25 000
GoldTrade EA
89+ USD
//+------------------------------------------------------------------+ //| XAUUSD Wolfe + SMC Quick Profit EA | //| MT5 / MQL5 | //+------------------------------------------------------------------+ #property strict #include <Trade/Trade.mqh> CTrade trade; //================================================================== // INPUTS //================================================================== //--- General
Trading view indicator fixing
30+ USD
can you help me with I have an indicator that I built and I work with PickMyTrade. The entries come through the alerts I get from Trading View . Trading View needs to send an alert and PickMyTrade executes a trade at that exact same second. Now, I have a problem in Trading View with the synchronization between the alert and the signal. I have a box that I built for a trade. It needs to output the box and get an
Looking for a developer in NinjaTrader For coding Inst - ES,NQ Chart type - Tick, range, volume & time Brief- Fib levels mapped on chart which act as entries, tgts and stops all based on candle close. (Maybe) use MACD for filtering direction. Daily manual input of the TWO fib Anchor levels is part of the strategy. I need a well experienced developer to bid and before biding check the attached file well. the PDF and
Modification of an existing MQL5 EA TH-05
30 - 300 USD
I Have an existing Mql5 Expert advisor (source code), I want a professional programmer to help me Modify the EA... so that it can stop taking new trades once it Gets to a Pacific Lots Size or Floating loss
EA LOTS SIZE MODIFICATION !!!
30 - 300 USD
I Have an existing Mql5 Expert advisor (source code), I want a professional programmer to help me Modify the EA... so that it can stop taking new trades once it Gets to a Pacific Lots Size or Floating loss
The Ultimate Trading Bot
30+ USD
take your time better make it for days and have good bot than never benefits both of us. Make the bot have zero errors and backtest it for a 2 year period
Informations sur le projet
Budget
68+ USD
Délais
de 15 à 33 jour(s)
Client
Commandes passées1
Nombre d'arbitrages0