MQL5
Asesores Expertos
Fórex
Depuración de robots/indicadores
Optimización de estrategias
Estadística y matemáticas
C++
Módulo de estrategias
Paneles de Control y Ventanas de Diálogo
Python
C#
Acciones
Gráficos personalizados
Futuros
MySQL
Diseño de productos
JavaScript
Opciones
Java
HTML
PHP
Carga de datos a la página
Minería de datos
Escritura de textos
Traducción de textos
ALGLIB
Tarea técnica
// Déclaration des paramètres externes input int FastMA = 9; // Période de la MA rapide input int SlowMA = 21; // Période de la MA lente input int RSI_Period = 14; // Période du RSI input double LotSize = 0.1; // Taille du lot input int Slippage = 3; // Slippage maximum input int StopLoss = 50; // Stop Loss en pips input int TakeProfit = 100; // Take Profit en pips input bool UseFibonacci = true; // Activer ou désactiver la stratégie Fibonacci input bool UseScalping = true; // Activer ou désactiver la stratégie Scalping input int Scalping_TickSize = 5; // Nombre de ticks pour activer le scalping
// Déclaration des variables globales double FastMA_Value, SlowMA_Value, RSI_Value; double SupportLevel, ResistanceLevel; double FibRetracementLevel1, FibRetracementLevel2;
// Fonction d'initialisation de l'Expert Advisor int OnInit() {
Print("Expert Advisor chargé avec succès !");
return INIT_SUCCEEDED; }
// Fonction principale (OnTick) void OnTick() {
// Calcul des valeurs des indicateurs
FastMA_Value = iMA(Symbol(), PERIOD_CURRENT, FastMA, 0, MODE_SMA, PRICE_CLOSE, 0);
SlowMA_Value = iMA(Symbol(), PERIOD_CURRENT, SlowMA, 0, MODE_SMA, PRICE_CLOSE, 0);
RSI_Value = iRSI(Symbol(), PERIOD_CURRENT, RSI_Period, PRICE_CLOSE, 0);
// Calcul des niveaux de support et résistance SupportLevel = iLow(Symbol(), PERIOD_D1, 1); ResistanceLevel = iHigh(Symbol(), PERIOD_D1, 1);
// Calcul des niveaux de retracement Fibonacci (si activé) if (UseFibonacci) { double HighPrice = iHigh(Symbol(), PERIOD_D1, 0); double LowPrice = iLow(Symbol(), PERIOD_D1, 0); FibRetracementLevel1 = LowPrice + 0.236 * (HighPrice - LowPrice); FibRetracementLevel2 = LowPrice + 0.618 * (HighPrice - LowPrice); }
// Stratégie de tendance : Croisement de moyennes mobiles if (FastMA_Value > SlowMA_Value) { // Signal d'achat basé sur les moyennes mobiles if (OrderSend(Symbol(), OP_BUY, LotSize, Ask, Slippage, 0, 0, "Buy Trend", 0, 0, clrBlue) < 0) { Print("Erreur d'ouverture de l'ordre d'achat: ", GetLastError()); } } else if (FastMA_Value < SlowMA_Value) { // Signal de vente basé sur les moyennes mobiles if (OrderSend(Symbol(), OP_SELL, LotSize, Bid, Slippage, 0, 0, "Sell Trend", 0, 0, clrRed) < 0) { Print("Erreur d'ouverture de l'ordre de vente: ", GetLastError());
}
}
// Stratégie range-bound : Achetez au support, vendez à la résistance if (Bid <= SupportLevel) { // Acheter au support if (OrderSend(Symbol(), OP_BUY, LotSize, Ask, Slippage, 0, 0, "Buy Support", 0, 0, clrGreen) < 0) { Print("Erreur d'ouverture de l'ordre d'achat au support: ", GetLastError()); } } else if (Bid >= ResistanceLevel) { // Vendre à la résistance if (OrderSend(Symbol(), OP_SELL, LotSize, Bid, Slippage, 0, 0, "Sell Resistance", 0, 0, clrOrange) < 0) { Print("Erreur d'ouverture de l'ordre de vente à la résistance: ", GetLastError()); } }
// Stratégie de retracement : Fibonacci if (UseFibonacci) { if (Bid <= FibRetracementLevel1) { // Acheter sur un retracement de 23.6% if (OrderSend(Symbol(), OP_BUY, LotSize, Ask, Slippage, 0, 0, "Buy Fibonacci", 0, 0, clrYellow) < 0) { Print("Erreur d'ouverture de l'ordre d'achat sur retracement Fibonacci: ", GetLastError()); }
} else if (Bid <= FibRetracementLevel2) { // Acheter sur un retracement de 61.8% if (OrderSend(Symbol(), OP_BUY, LotSize, Ask, Slippage, 0, 0, "Buy Fibonacci 61.8%", 0, 0, clrPurple) < 0) { Print("Erreur d'ouverture de l'ordre d'achat sur retracement Fibonacci 61.8%: ", GetLastError()); }
}
}
// Stratégie de scalping : Entrées rapides sur petits mouvements if (UseScalping && MathAbs(Ask - Bid) <= Scalping_TickSize * Point) { // Si le mouvement est petit (scalping), entrer rapidement if (OrderSend(Symbol(), OP_BUY, LotSize, Ask, Slippage, 0, 0, "Scalping Buy", 0, 0, clrMagenta) < 0) { Print("Erreur d'ouverture d'un ordre de scalping d'achat: ", GetLastError()); } }
// Stratégie Momentum : Surachat/Sursouffrance avec le RSI if (RSI_Value > 70) { // Surachat : signal de vente if (OrderSend(Symbol(), OP_SELL, LotSize, Bid, Slippage, 0, 0, "Sell Overbought RSI", 0, 0, clrRed) < 0) { Print("Erreur d'ouverture de l'ordre de vente sur RSI suracheté: ", GetLastError()); } } else if (RSI_Value < 30) { // Survente : signal d'achat if (OrderSend(Symbol(), OP_BUY, LotSize, Ask, Slippage, 0, 0, "Buy Oversold RSI", 0, 0, clrGreen) < 0) { Print("Erreur d'ouverture de l'ordre d'achat sur RSI survendu: ", GetLastError()); } }
// Stratégie Breakout : En cas de rupture de résistance/support (exemple simplifié) if (Bid > ResistanceLevel + 10 * Point) { // Acheter sur la rupture de la résistance if (OrderSend(Symbol(), OP_BUY, LotSize, Ask, Slippage, 0, 0, "Buy Breakout", 0, 0, clrBlue) < 0) { Print("Erreur d'ouverture de l'ordre d'achat sur breakout: ", GetLastError()); } } else if (Bid < SupportLevel - 10 * Point) { // Vendre sur la rupture du support if (OrderSend(Symbol(), OP_SELL, LotSize, Bid, Slippage, 0, 0, "Sell Breakout", 0, 0, clrRed) < 0) { Print("Erreur d'ouverture de l'ordre de vente sur breakout: ", GetLastError()); } } }
// Fonction de nettoyage (lors de la désactivation de l'EA) void OnDeinit(const int reason) { Print("Expert Advisor désactivé."); }
Han respondido
1
Evaluación
Proyectos
662
32%
Arbitraje
42
45%
/
45%
Caducado
12
2%
Trabaja
2
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Trabaja
3
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
4
Evaluación
Proyectos
477
40%
Arbitraje
105
40%
/
24%
Caducado
81
17%
Trabajando
Ha publicado: 2 ejemplos
5
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
Existing MT5 EA already operational. Task is strictly limited to: 1. inspect existing code 2. isolate the exact root cause of one critical behavior 3. provide a written diagnosis first 4. implement a minimal fix only after approval No rewrite. No redesign. No refactoring. No optimization campaign. No architecture change. No new features. Developers proposing reconstruction or major improvements are not suitable for
Información sobre el proyecto
Presupuesto
150+ USD