Termos de Referência
Project Title: Liquidity Sniper Semi-EA (Fibonacci & SMC Based)
Platform: MetaTrader 5 (MQL5)
Target Asset: XAUUSD (High Volatility) / M5 Timeframe
1. EA Operating Concept (Semi-Automated)
-
Human-Machine Collaboration: The trader manually draws a standard Fibonacci Retracement object on the M15 chart to define the market structure (setting the 1.0 and 0.0 anchor points).
-
EA's Role: The EA runs in the background. It must dynamically retrieve the price coordinates of the 1.0 and 0.0 anchors of this specific Fibonacci object. It then calculates specific operational zones, monitors the M5 timeframe for specific Price Action/SMC triggers, and fully automates trade execution (Lot size calculation, Entry, SL, TP) without human intervention.
2. Core Operational Zones (Dynamic Calculation)
Based on the 1.0 and 0.0 anchor prices retrieved from the chart's Fibo object, the EA must calculate and strictly monitor the following zones:
-
Zone 1: OTZ (Optimal Trade Zone): Between the 61.8% and 78.6% Fibonacci levels.
-
Zone 2: Bottom LQ Zone: Between the -11.3% (LQ SWEEP) and -27.2% (LQ RUN) levels.
-
Zone 3: Top LQ Zone: Between the 111.3% (LQ SWEEP) and 127.2% (LQ RUN) levels.
(Constraint: If the current M5 price is outside these specific zones, the EA must remain dormant. No trades allowed.)
3. Entry Signal Recognition (M5 Triggers)
The EA monitors the M5 timeframe for the following candlestick patterns only when the price is inside the active zones.
CRITICAL: The EA must strictly wait for the M5 candle to CLOSE before confirming the signal. No intra-bar (tick-based) execution to prevent fake-outs.
-
Trigger A: Liquidity Sweep Pinbar
-
Morphology: A candlestick with a long wick (the wick must represent >= 60% of the total candle length).
-
Sweep Confirmation: The extreme tip of this wick must pierce (be higher/lower than) the highest high / lowest low of the previous N M5 candles (Input parameter: Lookback_N , default = 8).
-
-
Trigger B: Engulfing Sweep
-
Morphology: A standard Engulfing pattern (Bullish or Bearish).
-
Sweep Confirmation: The extreme high/low of this 2-candle pattern must also pierce the highest high / lowest low of the previous N M5 candles.
-
4. Tactical Execution Matrix (Dual-Directional Logic)
When the price is in a valid zone and a trigger is confirmed, execute as follows:
-
Scenario A: Inside OTZ (61.8% - 78.6%)
-
Condition: Valid trend-following trigger appears.
-
Action: Open position $\rightarrow$ Set TP at 0.0 Fibonacci level.
-
-
Scenario B: Inside Bottom LQ Zone (-11.3% to -27.2%)
-
Sub-scenario B1 (Reversal): Bullish trigger appears $\rightarrow$ Open BUY $\rightarrow$ Set TP at 0.5 (EQUILIBRIUM).
-
Sub-scenario B2 (LQ RUN/Breakout): Bearish trigger appears OR a strong bearish candle closes completely below -27.2% $\rightarrow$ Open SELL $\rightarrow$ Set TP at -0.618 (TP limit).
-
-
Scenario C: Inside Top LQ Zone (111.3% to 127.2%)
-
Sub-scenario C1 (Reversal): Bearish trigger appears $\rightarrow$ Open SELL $\rightarrow$ Set TP at 0.5 (EQUILIBRIUM).
-
Sub-scenario C2 (LQ RUN/Breakout): Bullish trigger appears OR a strong bullish candle closes completely above 127.2% $\rightarrow$ Open BUY $\rightarrow$ Set TP at 1.618 (TP limit).
-
5. Ironclad Risk & Order Management (Crucial)
-
Dynamic Lot Sizing:
-
Provide an input parameter: Risk_Percentage (e.g., 1.0%).
-
Stop Loss (SL) placement: Placed exactly at the extreme high/low of the sweeping trigger candle + a buffer of X points (Input parameter: SL_Buffer_Points , default = 20).
-
The EA must automatically calculate the exact lot size based on the account free margin, the calculated SL distance, and the Risk_Percentage .
-
-
3-Strike Circuit Breaker (Anti-Whipsaw):
-
The EA must track the unique coordinates (or timestamp) of the currently active Fibonacci object.
-
If the EA hits 3 consecutive Stop Losses trading based on this specific Fibo object, it must enter "Sleep Mode" and halt all trading.
-
-
Circuit Breaker Reset Logic:
-
The EA continuously monitors the Fibonacci object on the chart.
-
The consecutive loss counter resets to 0 ONLY IF the trader manually redraws the Fibonacci object OR significantly moves the 1.0 or 0.0 anchor prices (indicating a new market structure has been established).
-