MQL5
Experts
Forex
Trading robot/indicator debugging
Strategy optimization
Statistics and mathematics
C++
Strategy modules
Panels and dialog boxes
Python
C#
Stocks
Custom graphics
Futures
MySQL
Product Design
JavaScript
Options
Java
HTML
PHP
Uploading data to a website
Data mining
Text writing
Text translation
ALGLIB
Spécifications
// 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é."); }
Répondu
1
Évaluation
Projets
662
32%
Arbitrage
42
45%
/
45%
En retard
12
2%
Travail
2
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Travail
3
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
4
Évaluation
Projets
477
40%
Arbitrage
105
40%
/
24%
En retard
81
17%
Chargé
Publié : 2 codes
5
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
Commandes similaires
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
Informations sur le projet
Budget
150+ USD