MQL5
전문가
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
명시
// 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é."); }
응답함
1
등급
프로젝트
624
33%
중재
39
36%
/
49%
기한 초과
11
2%
바쁜
2
등급
프로젝트
0
0%
중재
0
기한 초과
0
작업중
3
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
4
등급
프로젝트
471
39%
중재
102
40%
/
24%
기한 초과
78
17%
바쁜
게재됨: 2 코드
5
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
Akaba Marc
100+ USD
Les conditions son clair les candidats pourront apprendre beaucoup sur les services du marketing dans le domaine du monde opératoire de l'utilisation du robot virtuel de nombreuses manières d'investissement et pourra pur jouer plusieurs rôles sur plusieurs plans
프로젝트 정보
예산
150+ USD