Specifiche
//+------------------------------------------------------------------+
//| 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();
}
Con risposta
1
Valutazioni
Progetti
658
32%
Arbitraggio
43
42%
/
44%
In ritardo
11
2%
Caricato
2
Valutazioni
Progetti
319
29%
Arbitraggio
34
26%
/
65%
In ritardo
10
3%
Gratuito
3
Valutazioni
Progetti
7
0%
Arbitraggio
2
50%
/
0%
In ritardo
1
14%
In elaborazione
4
Valutazioni
Progetti
173
25%
Arbitraggio
23
9%
/
78%
In ritardo
16
9%
In elaborazione
5
Valutazioni
Progetti
9
11%
Arbitraggio
0
In ritardo
0
Gratuito
6
Valutazioni
Progetti
157
42%
Arbitraggio
3
33%
/
33%
In ritardo
1
1%
Occupato
7
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
8
Valutazioni
Progetti
2
0%
Arbitraggio
0
In ritardo
0
Gratuito
9
Valutazioni
Progetti
33
24%
Arbitraggio
3
33%
/
33%
In ritardo
4
12%
In elaborazione
10
Valutazioni
Progetti
288
35%
Arbitraggio
18
22%
/
61%
In ritardo
42
15%
In elaborazione
11
Valutazioni
Progetti
88
28%
Arbitraggio
24
13%
/
58%
In ritardo
7
8%
Caricato
12
Valutazioni
Progetti
19
26%
Arbitraggio
0
In ritardo
3
16%
Gratuito
13
Valutazioni
Progetti
20
0%
Arbitraggio
10
0%
/
80%
In ritardo
6
30%
Gratuito
14
Valutazioni
Progetti
559
35%
Arbitraggio
80
31%
/
44%
In ritardo
203
36%
Gratuito
15
Valutazioni
Progetti
125
24%
Arbitraggio
23
26%
/
52%
In ritardo
8
6%
In elaborazione
16
Valutazioni
Progetti
5
0%
Arbitraggio
3
33%
/
67%
In ritardo
2
40%
Gratuito
17
Valutazioni
Progetti
169
38%
Arbitraggio
9
78%
/
22%
In ritardo
15
9%
Gratuito
18
Valutazioni
Progetti
373
72%
Arbitraggio
19
32%
/
47%
In ritardo
14
4%
Gratuito
Pubblicati: 14 codici
19
Valutazioni
Progetti
20
40%
Arbitraggio
1
0%
/
100%
In ritardo
1
5%
Gratuito
20
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
21
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
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
BTC 5 Minutes scalping
50 - 100 USD
import { useState, useEffect, useRef } from "react"; const INIT_LOT = 0.01; const TP_MOVE = 200; const SL_MOVE = 120; const START_BALANCE = 1000; const MAX_LOT = 5.12; const TICK_MS = 1200; function ema(arr, n) { if (arr.length < n) return null; const k = 2 / (n + 1); let e = arr.slice(0, n).reduce((s, v) => s + v, 0) / n; for (let i = n; i < arr.length; i++) e = arr[i] * k + e * (1 - k); return e; } function
Advanced Hedge + Grid + Scalping system
300 - 500 USD
🚀 ADAPTIVE GRID HEDGE EA (FULL VERSION) 🧠 📌 GENERAL CONCEPT This Expert Advisor (EA) uses a strategy combining: Grid trading (order grid) Hedge (protection with opposite positions) Lot scaling (progressive) Loss compensation with profits Continuous operation (non-stop) Focus on: Small recurring profits High trade volume (rebate/IB) The system does not depend on direction, but rather on market oscillation . Main
Neew arrow indiactor fix
30+ USD
I have a indicator working good but have some bug for arrow placement . budget is fixed 30 used . only experience developer apply. i want to arrow get put on just above the candle high and candle low
I need a professional MT5 Expert Advisor (EA) built with clean, modular code. This is an advanced strategy combining liquidity concepts, controlled DCA, hedge protection, and strict risk management. Core Requirements: Entry Logic (ALL must align): Liquidity sweep (Previous Day High/Low breakout and return) EMA50 and EMA200 trend alignment Higher timeframe bias (H1 or H4) RSI confirmation Bollinger Band entry Filters
Custom MT5 EA - Perpetual NDA Required
1000 - 2000 USD
I need a professional MQL5 developer. BEFORE I SHARE ANY DETAILS: 1. You must sign a PERPETUAL NDA with no expiration date 2. NDA includes €100,000 penalty for any breach 3. I require full .mq5 source code ownership 4. Developer must have 500+ completed jobs, 4.9+ rating Budget: €1500 EUR Duration: 14 days Start your application with "RULER" to prove you read this
i have a simple strategy can you please create the automated forex ea to execute my trading strategy? i need custom ea for tradingview and mt4/mt5 correction: i need a tradingview indicator created that tells me when to buy or sell. and ea in mt4/mt5
Pip Scalper Bot
60+ USD
i want a trading bot that is aleast 98% sure,and cam also do scalping 99% correct using smart money concept, ICT, ALL technical analysis on it and also put risk management on it
It is very important, that your software can replicate the trade logic 1:1 as the original myfxbook statistic. You should have a professional software to analyze the trade logic. I tried it with ChatGPT and GROK and it doesnt worked at all. You need to have better tools for that job. If you can not do it to 99% same trade logic as the original statistic do not message me. Payment only after delivering the EA (Demo
Informazioni sul progetto
Budget
30 - 200 USD
IVA (20%):
6
-
40
USD
Totale:
36
-
240
USD
Per lo sviluppatore
27
- 180
USD
Scadenze
da 1 a 31 giorno(i)
Cliente
Ordini effettuati1
Numero di arbitraggi0