Spécifications
//+------------------------------------------------------------------+
//| ProTradingEA MT5 |
//| Fully MT5-compliant with MACD, Trailing Stop, Break-Even |
//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>
CTrade trade;
// Optional override
input string SymbolOverride = ""; // leave blank to auto-detect
struct EASettings
{
int FastMAPeriod;
int SlowMAPeriod;
int RSIPeriod;
double RSIOverbought;
double RSIOversold;
int MACDFast;
int MACDSlow;
int MACDSignal;
double RiskPercent;
double ATRMultiplierSL;
double ATRMultiplierTP;
int ATRPeriod;
int TrailingStopPoints;
bool TradeLondonNY;
double PartialClosePercent;
string NewsStartTimes;
string NewsEndTimes;
};
EASettings settings;
double fastMA, slowMA;
double prevFastMA, prevSlowMA;
// MACD handles
int macdHandle;
double macdBuffer[], signalBuffer[], histBuffer[];
//+------------------------------------------------------------------+
//| Set defaults per symbol |
//+------------------------------------------------------------------+
void SetDefaults()
{
string sym = SymbolOverride != "" ? SymbolOverride : Symbol();
if(sym == "EURUSD") settings = {10,50,14,70,30,12,26,9,1.0,1.0,2.0,14,200,true,50,"13:30,15:00","14:30,15:30"};
else if(sym == "GBPUSD") settings = {12,55,14,70,30,12,26,9,1.0,1.2,2.2,14,250,true,50,"13:30,15:00","14:30,15:30"};
else if(sym == "USDJPY") settings = {10,50,14,70,30,12,26,9,1.0,1.0,2.0,14,150,true,50,"13:30,15:00","14:30,15:30"};
else settings = {10,50,14,70,30,12,26,9,1.0,1.0,2.0,14,200,true,50,"13:30,15:00","14:30,15:30"};
}
//+------------------------------------------------------------------+
//| Initialize EA |
//+------------------------------------------------------------------+
int OnInit()
{
SetDefaults();
// Create MACD handle
macdHandle = iMACD(Symbol(), PERIOD_CURRENT, settings.MACDFast, settings.MACDSlow, settings.MACDSignal, PRICE_CLOSE);
if(macdHandle == INVALID_HANDLE)
{
Print("Error creating MACD handle");
return INIT_FAILED;
}
return INIT_SUCCEEDED;
}
//+------------------------------------------------------------------+
//| Calculate lot size based on risk |
//+------------------------------------------------------------------+
double CalculateLotSize(double stopLossPoints)
{
double balance = AccountInfoDouble(ACCOUNT_BALANCE);
double riskAmount = balance * settings.RiskPercent / 100.0;
double tickValue = SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_VALUE);
double tickSize = SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_SIZE);
double lot = riskAmount / (stopLossPoints * tickValue / tickSize);
double minLot = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MIN);
double maxLot = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MAX);
double step = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_STEP);
lot = MathMax(minLot, MathMin(maxLot, lot));
lot = MathFloor(lot/step)*step;
return NormalizeDouble(lot, 2);
}
//+------------------------------------------------------------------+
//| Check if trading is allowed (session + news filter) |
//+------------------------------------------------------------------+
bool IsTradingAllowed()
{
// Session filter
if(settings.TradeLondonNY)
{
int hour = TimeHour(TimeCurrent());
if(hour < 8 || hour > 17) return false;
}
// News filter
string starts[], ends[];
int startCount = StringSplit(settings.NewsStartTimes, ',', starts);
int endCount = StringSplit(settings.NewsEndTimes, ',', ends);
if(startCount != endCount) return true; // skip if mismatched
for(int i=0;i<startCount;i++)
{
int sh = StringToInteger(StringSubstr(starts[i],0,2));
int sm = StringToInteger(StringSubstr(starts[i],3,2));
int eh = StringToInteger(StringSubstr(ends[i],0,2));
int em = StringToInteger(StringSubstr(ends[i],3,2));
int curHour = TimeHour(TimeCurrent());
int curMin = TimeMinute(TimeCurrent());
if((curHour > sh || (curHour == sh && curMin >= sm)) &&
(curHour < eh || (curHour == eh && curMin <= em)))
return false;
}
return true;
}
//+------------------------------------------------------------------+
//| Manage positions: Trailing Stop, Break-Even, Partial Close |
//+------------------------------------------------------------------+
void ManagePositions()
{
if(!PositionSelect(Symbol())) return;
double openPrice = PositionGetDouble(POSITION_PRICE_OPEN);
double sl = PositionGetDouble(POSITION_SL);
double tp = PositionGetDouble(POSITION_TP);
double volume = PositionGetDouble(POSITION_VOLUME);
long type = PositionGetInteger(POSITION_TYPE);
double price = (type == POSITION_TYPE_BUY) ? SymbolInfoDouble(Symbol(), SYMBOL_BID) : SymbolInfoDouble(Symbol(), SYMBOL_ASK);
// Trailing Stop
if(type == POSITION_TYPE_BUY)
{
double newSL = price - settings.TrailingStopPoints * _Point;
if(newSL > sl && newSL > openPrice)
trade.PositionModify(Symbol(), newSL, tp);
// Break-Even + Partial Close
if(price - openPrice >= (tp - openPrice)/2 && sl < openPrice)
{
trade.PositionModify(Symbol(), openPrice, tp);
double closeVol = volume * settings.PartialClosePercent / 100.0;
trade.PositionClosePartial(Symbol(), closeVol);
}
}
if(type == POSITION_TYPE_SELL)
{
double newSL = price + settings.TrailingStopPoints * _Point;
if(sl == 0 || newSL < sl)
trade.PositionModify(Symbol(), newSL, tp);
// Break-Even + Partial Close
if(openPrice - price >= (openPrice - tp)/2 && (sl == 0 || sl > openPrice))
{
trade.PositionModify(Symbol(), openPrice, tp);
double closeVol = volume * settings.PartialClosePercent / 100.0;
trade.PositionClosePartial(Symbol(), closeVol);
}
}
}
//+------------------------------------------------------------------+
//| OnTick |
//+------------------------------------------------------------------+
void OnTick()
{
if(!IsTradingAllowed()) return;
// MAs
fastMA = iMA(NULL,0,settings.FastMAPeriod,0,MODE_SMA,PRICE_CLOSE,0);
slowMA = iMA(NULL,0,settings.SlowMAPeriod,0,MODE_SMA,PRICE_CLOSE,0);
prevFastMA = iMA(NULL,0,settings.FastMAPeriod,0,MODE_SMA,PRICE_CLOSE,1);
prevSlowMA = iMA(NULL,0,settings.SlowMAPeriod,0,MODE_SMA,PRICE_CLOSE,1);
// RSI
double rsi = iRSI(NULL,0,settings.RSIPeriod,PRICE_CLOSE,0);
// MACD
if(CopyBuffer(macdHandle,0,0,1,macdBuffer) <= 0) return; // Main
if(CopyBuffer(macdHandle,1,0,1,signalBuffer) <= 0) return; // Signal
double macdHist = macdBuffer[0] - signalBuffer[0];
// ATR for SL/TP
double atr = iATR(NULL,0,settings.ATRPeriod,0);
double slPoints = settings.ATRMultiplierSL * atr / _Point;
double tpPoints = settings.ATRMultiplierTP * atr / _Point;
double lot = CalculateLotSize(slPoints);
bool hasPosition = PositionSelect(Symbol());
// BUY signal
if(prevFastMA < prevSlowMA && fastMA > slowMA && rsi < settings.RSIOverbought && macdHist > 0 && !hasPosition)
{
double price = SymbolInfoDouble(Symbol(), SYMBOL_ASK);
double sl = price - slPoints*_Point;
double tp = price + tpPoints*_Point;
trade.Buy(lot,Symbol(),price,sl,tp);
}
// SELL signal
if(prevFastMA > prevSlowMA && fastMA < slowMA && rsi > settings.RSIOversold && macdHist < 0 && !hasPosition)
{
double price = SymbolInfoDouble(Symbol(), SYMBOL_BID);
double sl = price + slPoints*_Point;
double tp = price - tpPoints*_Point;
trade.Sell(lot,Symbol(),price,sl,tp);
}
// Manage open positions
ManagePositions();
}
Répondu
1
Évaluation
Projets
660
32%
Arbitrage
43
44%
/
44%
En retard
11
2%
Chargé
2
Évaluation
Projets
319
29%
Arbitrage
34
26%
/
65%
En retard
10
3%
Gratuit
3
Évaluation
Projets
7
0%
Arbitrage
2
50%
/
0%
En retard
1
14%
Travail
4
Évaluation
Projets
173
25%
Arbitrage
23
9%
/
78%
En retard
16
9%
Travail
5
Évaluation
Projets
9
11%
Arbitrage
0
En retard
0
Gratuit
6
Évaluation
Projets
159
43%
Arbitrage
3
33%
/
33%
En retard
1
1%
Chargé
7
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
8
Évaluation
Projets
2
0%
Arbitrage
0
En retard
0
Gratuit
9
Évaluation
Projets
33
24%
Arbitrage
3
33%
/
33%
En retard
4
12%
Travail
10
Évaluation
Projets
288
35%
Arbitrage
18
22%
/
61%
En retard
42
15%
Travail
11
Évaluation
Projets
89
28%
Arbitrage
24
13%
/
58%
En retard
7
8%
Travail
12
Évaluation
Projets
19
26%
Arbitrage
0
En retard
3
16%
Gratuit
13
Évaluation
Projets
20
0%
Arbitrage
10
0%
/
80%
En retard
6
30%
Gratuit
14
Évaluation
Projets
559
35%
Arbitrage
80
31%
/
44%
En retard
203
36%
Gratuit
15
Évaluation
Projets
125
24%
Arbitrage
23
26%
/
52%
En retard
8
6%
Travail
16
Évaluation
Projets
5
0%
Arbitrage
3
33%
/
67%
En retard
2
40%
Gratuit
17
Évaluation
Projets
169
38%
Arbitrage
9
78%
/
22%
En retard
15
9%
Gratuit
18
Évaluation
Projets
373
72%
Arbitrage
19
32%
/
47%
En retard
14
4%
Gratuit
Publié : 14 codes
19
Évaluation
Projets
20
40%
Arbitrage
1
0%
/
100%
En retard
1
5%
Gratuit
20
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
21
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
22
Évaluation
Projets
490
23%
Arbitrage
60
53%
/
25%
En retard
56
11%
Chargé
23
Évaluation
Projets
31
55%
Arbitrage
3
33%
/
33%
En retard
0
Travail
24
Évaluation
Projets
435
54%
Arbitrage
20
55%
/
15%
En retard
30
7%
Travail
25
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
26
Évaluation
Projets
26
27%
Arbitrage
0
En retard
2
8%
Gratuit
27
Évaluation
Projets
3380
68%
Arbitrage
77
48%
/
14%
En retard
342
10%
Gratuit
Publié : 1 code
28
Évaluation
Projets
1
100%
Arbitrage
0
En retard
0
Gratuit
29
Évaluation
Projets
285
41%
Arbitrage
15
13%
/
47%
En retard
67
24%
Gratuit
30
Évaluation
Projets
9
0%
Arbitrage
2
0%
/
50%
En retard
1
11%
Travail
31
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
32
Évaluation
Projets
477
40%
Arbitrage
105
40%
/
24%
En retard
81
17%
Chargé
Publié : 2 codes
33
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
34
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
35
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
36
Évaluation
Projets
1
0%
Arbitrage
5
0%
/
100%
En retard
0
Gratuit
Commandes similaires
I need an expert advisor at around 30$-50$
30 - 50 USD
"I need an MT5 EA based on price action — liquidity sweep + hammer/shooting star reversal strategy. TREND: Identified by HH/HL for uptrend, LL/LH for downtrend on selected timeframe. No trade in ranging conditions. BUY SETUP: In uptrend, price retraces to swing low zone, wicks below it (liquidity sweep), hammer forms (lower wick min 2x body, closes above swept low). Buy stop entry at hammer high. SL below hammer
I need a professional MQL5 developer to finalize a Gold (XAUUSD) trading bot. The core layering and support-filter logic is already drafted. Key Requirements: Refine a hybrid Martingale/Layering volume calculation (1-10 / 11-20 reset logic). Implement a robust "Safety Mode" based on Daily Low price breaks. Ensure precise 6:00 AM Server Time reset for logic variables. Add professional error handling (Slippage
I want an order manager ea for XAUUSD
30 - 50 USD
I want a gold order management ea that should be like the below... Pending orders When I open one manual order, ea should be able to set 3 pending orders at x amount of pips below (if buy order) or above (if sell order) manual order entry. So like this Pending order 1 true or false Pending order pips away: 20. Pending order lot size:0.3 Pending order 2 true or false Pending order pips away: 40 Pending order lot
EA SPECIFICATION SHEET OBJECTIVE: Build a transparent, non-martingale, non-grid breakout EA for XAUUSD that trades only high‑quality breakouts during London + New York sessions. 1. TRADING INSTRUMENT - XAUUSD only - MT4 platform - 5‑digit ECN broker 2. CORE STRATEGY LOGIC (BREAKOUT + CONFIRMATION) A trade is allowed ONLY when ALL conditions are true: - Candle closes beyond previous high/low (no wick breakouts) -
I am looking to develop a custom Expert Advisor (EA) for MetaTrader (MT4/MT5) based on a defined technical analysis strategy and flexible risk management rules. The EA should operate on a chart and timeframe that I manually specify, with the ability to adapt its behavior dynamically when the timeframe is changed. Core Strategy Logic The EA will execute trades based on predefined technical analysis zones
MT5 Manager API
30+ USD
make an api for mt5 and a trade copier eith the api thst uses local computer no cloud trader api ea mt5 that saves all trade data nd logs time and entry and exit tp sl logs delted pending order api that uses market execution not pending orfer
API our EA into an AI agent or perplexity
100 - 300 USD
Hello, we have an existing EA, and are building a new one. We want our EA to connect via API to an AI provider like Chat GPT, Claude, or perplexity. Can you connect a meta trader EA to an AI agent? if you can then i would like to speak. The system is quite simple, for example the EA would ask perplexity where the support is on EURUSD then place a trade, thank you, Rob
Hi, Im looking to purchase or build an EA that can open many trades or big lot size to churn out IB commission, it doesnt have to be super profitable but will need to have the number of trades on going in order to earn IB commission. Source code is required upon purchase. If you have any EA or strategy that are gearing towards this, let me know and i would be glad to purchase it. Please share the demo trial for me to
I currently have unfinished work. It’s a project to connect MetaTrader with the BingX platform. At the moment, I have implemented a service that retrieves a custom symbol in BingX, and it works well. However, some specifications still need to be adjusted regarding how the data is received. Otherwise, prices and other values are accurate. The only issue is that for the strategy tester, it is always necessary to
Modify an existing EA
30 - 50 USD
This is to modify my Semi Auto EA -Looking for developer modify my existing EA to Pending Order EA (BS/BL/SL/SS). Relevent with Heiken Ashi Smooth ,Moving Average , Acceleration. Concept MAster and Slave. Ready to give previous soucre code as guide. Work to do - 1)To modify this EA to Pending Order. 2) to add new feature - Risk Management/moneymanagement 3) To modify 4 slave to 7 slave will give the previous to
Informations sur le projet
Budget
30 - 200 USD
TVA (20%):
6
-
40
USD
Total:
36
-
240
USD
Pour le développeur
27
- 180
USD
Délais
de 1 à 31 jour(s)
Client
Commandes passées1
Nombre d'arbitrages0