Spezifikation
//+------------------------------------------------------------------+
//| XAUUSD Ultimate Institutional EA |
//| Features: |
//| - True swing-based market structure |
//| - BOS sniper entries on M5 |
//| - Liquidity sweep filter |
//| - Partial TP + breakeven |
//| - Visual BOS, swings, liquidity |
//| - ATR-based dynamic SL |
//| - Trailing stop |
//| - Session filter (London + NY) |
//| - Risk management (1% per trade) |
//+------------------------------------------------------------------+
#property strict
#include <Trade/Trade.mqh>
CTrade trade;
//================ INPUTS =================
input double RiskPercent = 1.0; // % risk per trade
input double RR = 2.0; // Target RR
input double PartialClosePercent = 50.0; // % to close at first TP
input int SL_Buffer_Points = 400; // SL buffer (XAU volatility)
input int MaxSL_Points = 3000; // Skip trades if SL too wide
input ENUM_TIMEFRAMES HTF = PERIOD_H1; // Higher timeframe
input ENUM_TIMEFRAMES LTF = PERIOD_M5; // Lower timeframe
input int LondonStart = 10; // London session start
input int LondonEnd = 13; // London session end
input int NYStart = 15; // NY session start
input int NYEnd = 18; // NY session end
input bool UseNewsFilter = true; // Toggle news filter
input int NewsPauseBefore = 30; // Minutes before news
input int NewsPauseAfter = 30; // Minutes after news
input int FractalDepth = 2; // For true swing detection
input int ATR_Period = 14; // ATR period
input double ATR_Multiplier = 1.5; // ATR multiplier for SL
input double TrailingStart = 1.0; // RR ratio to start trailing
input double TrailingStep = 50; // Points per trailing move
//================ GLOBALS =================
datetime LastTradeDay;
bool PartialTaken = false;
bool BuyLiquidityTaken = false;
bool SellLiquidityTaken = false;
double LastSwingHigh = 0;
double PrevSwingHigh = 0;
double LastSwingLow = 0;
double PrevSwingLow = 0;
//================ SESSION CHECK =================
bool InSession()
{
int h = TimeHour(TimeCurrent());
return (h>=LondonStart && h<=LondonEnd) || (h>=NYStart && h<=NYEnd);
}
//================ TRUE SWING DETECTION =================
void DetectSwings()
{
for (int i = 5; i < 100; i++)
{
double fh = iFractals(_Symbol, HTF, MODE_UPPER, i);
double fl = iFractals(_Symbol, HTF, MODE_LOWER, i);
if (fh != 0)
{
PrevSwingHigh = LastSwingHigh;
LastSwingHigh = fh;
}
if (fl != 0)
{
PrevSwingLow = LastSwingLow;
LastSwingLow = fl;
}
if (PrevSwingHigh > 0 && PrevSwingLow > 0) break;
}
}
//================ MARKET STRUCTURE =================
bool BullishStructure()
{
DetectSwings();
return (LastSwingHigh > PrevSwingHigh &&
LastSwingLow > PrevSwingLow);
}
bool BearishStructure()
{
DetectSwings();
return (LastSwingHigh < PrevSwingHigh &&
LastSwingLow < PrevSwingLow);
}
//================ LOT CALCULATION =================
double LotByRisk(double sl_points)
{
double bal = AccountInfoDouble(ACCOUNT_BALANCE);
double riskMoney = bal * RiskPercent / 100.0;
double tickVal = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
double tickSz = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
double lot = riskMoney / (sl_points * tickVal / tickSz);
return NormalizeDouble(lot, 2);
}
//================ LIQUIDITY SWEEP =================
void DetectLiquiditySweep(double ltf_low, double ltf_high, double close)
{
BuyLiquidityTaken = (ltf_low < LastSwingLow && close > LastSwingLow);
SellLiquidityTaken = (ltf_high > LastSwingHigh && close < LastSwingHigh);
// Visualize sweeps
if(BuyLiquidityTaken)
DrawLabel("LIQ_SWEEP_BUY", TimeCurrent(), LastSwingLow, "Sell-side Liquidity Taken", clrDodgerBlue);
if(SellLiquidityTaken)
DrawLabel("LIQ_SWEEP_SELL", TimeCurrent(), LastSwingHigh, "Buy-side Liquidity Taken", clrOrangeRed);
}
//================ DRAWING FUNCTIONS =================
void DrawLine(string name, datetime t1, double p1, datetime t2, double p2, color clr)
{
ObjectDelete(0, name);
ObjectCreate(0, name, OBJ_TREND, 0, t1, p1, t2, p2);
ObjectSetInteger(0, name, OBJPROP_COLOR, clr);
ObjectSetInteger(0, name, OBJPROP_WIDTH, 2);
}
void DrawLabel(string name, datetime t, double p, string text, color clr)
{
ObjectDelete(0, name);
ObjectCreate(0, name, OBJ_TEXT, 0, t, p);
ObjectSetText(name, text, 10, "Arial", clr);
}
//================ ATR =================
double ATR(int period, ENUM_TIMEFRAMES tf)
{
return iATR(_Symbol, tf, period, 0);
}
//================ PARTIAL TP + BREAKEVEN =================
void ManagePosition()
{
if (!PositionSelect(_Symbol)) return;
double entry = PositionGetDouble(POSITION_PRICE_OPEN);
double sl = PositionGetDouble(POSITION_SL);
double tp = PositionGetDouble(POSITION_TP);
double vol = PositionGetDouble(POSITION_VOLUME);
int type = PositionGetInteger(POSITION_TYPE);
double price = (type==POSITION_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_BID)
: SymbolInfoDouble(_Symbol, SYMBOL_ASK);
double risk = MathAbs(entry - sl);
double oneR = (type==POSITION_TYPE_BUY) ? entry + risk : entry - risk;
// Partial TP
if (!PartialTaken &&
((type==POSITION_TYPE_BUY && price >= oneR) ||
(type==POSITION_TYPE_SELL && price <= oneR)))
{
trade.PositionClosePartial(_Symbol, vol * PartialClosePercent / 100.0);
trade.PositionModify(_Symbol, entry, tp); // move SL to breakeven
PartialTaken = true;
}
// Trailing Stop
double rrAchieved = (type==POSITION_TYPE_BUY) ? (price - entry)/risk : (entry - price)/risk;
if(rrAchieved >= TrailingStart)
{
double new_sl;
if(type==POSITION_TYPE_BUY)
new_sl = price - TrailingStep*_Point;
else
new_sl = price + TrailingStep*_Point;
if((type==POSITION_TYPE_BUY && new_sl > sl) ||
(type==POSITION_TYPE_SELL && new_sl < sl))
{
trade.PositionModify(_Symbol, new_sl, tp);
}
}
}
//================ NEWS FILTER PLACEHOLDER =================
bool NewsSafe()
{
if(!UseNewsFilter) return true;
// Placeholder: safe, can integrate news API
return true;
}
//================ MAIN LOGIC =================
void OnTick()
{
if(_Symbol != "XAUUSD") return;
if(!InSession()) return;
if(!NewsSafe()) return;
ManagePosition();
if(PositionsTotal() > 0) return;
double close = iClose(_Symbol, LTF, 1);
double prevHigh = iHigh(_Symbol, LTF, 2);
double prevLow = iLow(_Symbol, LTF, 2);
DetectLiquiditySweep(prevLow, prevHigh, close);
double atr = ATR(ATR_Period, LTF);
//================ BUY =================
if(BullishStructure() && BuyLiquidityTaken && close > prevHigh)
{
double entry = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
double sl = entry - atr * ATR_Multiplier;
double sl_points = (entry - sl)/_Point;
if(sl_points > MaxSL_Points) return;
double tp = entry + (entry - sl) * RR;
double lot = LotByRisk(sl_points);
trade.Buy(lot, _Symbol, entry, sl, tp);
PartialTaken = false;
DrawLine("BOS_BUY", iTime(_Symbol,LTF,2), prevHigh, iTime(_Symbol,LTF,1), close, clrLime);
DrawLabel("BOS_BUY_LABEL", iTime(_Symbol,LTF,1), close, "BOS BUY", clrLime);
}
//================ SELL =================
if(BearishStructure() && SellLiquidityTaken && close < prevLow)
{
double entry = SymbolInfoDouble(_Symbol, SYMBOL_BID);
double sl = entry + atr * ATR_Multiplier;
double sl_points = (sl - entry)/_Point;
if(sl_points > MaxSL_Points) return;
double tp = entry - (sl - entry) * RR;
double lot = LotByRisk(sl_points);
trade.Sell(lot, _Symbol, entry, sl, tp);
PartialTaken = false;
DrawLine("BOS_SELL", iTime(_Symbol,LTF,2), prevLow, iTime(_Symbol,LTF,1), close, clrRed);
DrawLabel("BOS_SELL_LABEL", iTime(_Symbol,LTF,1), close, "BOS SELL", clrRed);
}
}
Bewerbungen
1
Bewertung
Projekte
33
52%
Schlichtung
1
100%
/
0%
Frist nicht eingehalten
1
3%
Frei
2
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
3
Bewertung
Projekte
2
0%
Schlichtung
0
Frist nicht eingehalten
0
Arbeitet
4
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
5
Bewertung
Projekte
3
33%
Schlichtung
2
0%
/
100%
Frist nicht eingehalten
0
Frei
6
Bewertung
Projekte
15
13%
Schlichtung
6
0%
/
67%
Frist nicht eingehalten
2
13%
Frei
7
Bewertung
Projekte
8
0%
Schlichtung
8
13%
/
88%
Frist nicht eingehalten
0
Frei
8
Bewertung
Projekte
19
42%
Schlichtung
3
0%
/
67%
Frist nicht eingehalten
3
16%
Arbeitet
9
Bewertung
Projekte
1
0%
Schlichtung
1
0%
/
100%
Frist nicht eingehalten
1
100%
Arbeitet
10
Bewertung
Projekte
5
60%
Schlichtung
1
0%
/
0%
Frist nicht eingehalten
2
40%
Frei
Veröffentlicht: 1 Beispiel
11
Bewertung
Projekte
144
46%
Schlichtung
20
40%
/
15%
Frist nicht eingehalten
32
22%
Arbeitet
12
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Arbeitet
13
Bewertung
Projekte
0
0%
Schlichtung
0
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
I’ve been following your profile and I'm interested in your expertise with the ATAS API and C# development. I have a clear technical scope for a high-performance M1 indicator focused on Binary Options and Scalping. The core logic is based on institutional Order Flow convergence: Stacked Imbalances: 300% ratio with a minimum of 3 consecutive levels. Delta/Price Divergence: Filtering for market exhaustion (New Highs
Hello, I’m looking for an experienced MQL4/MQL5 developer to work with me on an ongoing basis. My clients request services such as: Converting TradingView Pine Script indicators/strategies into MT4 or MT5 Expert Advisors Converting MT4 EAs to MT5 (and MT5 to MT4) Compiling and fixing existing MQL4 / MQL5 EA code Adding simple features like alerts, SL/TP, lot size, and basic money management This job is for
EA developer with stregegy builder required
50 - 100 USD
Looking for an experienced MQL5 developer to design and develop a custom Expert Advisor (EA) for MetaTrader 5. The purpose of this EA is not just automated trading, but also to help me better structure, test, and refine my personal trading strategy
Freeallfree
400 - 800 USD
Professional MT5 EA – XAUUSD I need a professional Expert Advisor for MT5 (MQL5) to trade XAUUSD only. This is not a random scalping bot. The EA must trade only high-probability liquidity breakouts during active sessions and avoid ranging or low-volatility markets. Symbol: XAUUSD Timeframe: M15 (optional H1 confirmation) Session filter (Dubai GMT+4): Trade only London and New York sessions Adjustable session times No
Data Integrity
500 - 1000 USD
The trading bot is an automated software system designed to monitor financial markets, execute trades, and manage risk based on predefined strategies. The bot aims to maximize profits while minimizing human intervention and emotional decision-making. Scope: Supports automated trading on selected exchanges (e.g., Binance, Bitget, Coinbase). Executes trades based on technical indicators, signals, or AI models. Provides
1. General Objective Development of an Expert Advisor in MQL5 intended for Futures markets , based on an existing trading strategy that I will provide (described logic or precise rules). The main objectives are: Faithful implementation of the strategy , Full debugging of the EA, Validation of correct behavior through backtesting. 2. Markets and Instruments Markets: Futures Symbols: to be defined (e.g. indices
I need help in modifying an amibroker AFL indicator the indicator already works but I need per symbol static variable isolation, parameters persistence per symbol after restart, non declining trailing stop logic, parameter auto restore when switching symbols and a global reset function for static variables. For better understanding As discussed, this is the official offer for restructuring my RAD Chandelier stop loss
Hello there Hpe you are doing good I am in search of a pine script expert developer who can build strategy in apudFlow in pinescript. Kinldy bid on this project if you can do this
hello every one i have a sample strategy i need a expert for automatical trade on vps pls let me know if every one can summer of expert : mixed 2 EMA and hicenashi + money managment i will need test befor pay
I need editing of EA
30+ USD
Am looking for am experience Programmer who can Edit and compile 2 Ea"s that i built with the help of CHATGPT. I need the job to be done within one day and I will prove the source code
Projektdetails
Budget
300+ USD
Ausführungsfristen
von 1 bis 10 Tag(e)