Liquidity Sweeper
- Experts
- Filip Dockal
- Versione: 1.0
- Attivazioni: 20
Liquidity Sweeper EA
Liquidity Sweeper EA is a rule-based Expert Advisor for MetaTrader 5 that trades a clean, widely used Smart Money Concepts workflow:
- Detect market structure swings (HH/HL or LL/LH)
- Confirm a Break of Structure (BOS) using a candle close beyond the previous swing
- Wait for a liquidity sweep of the opposite swing level (SSL/BSL)
- Enter only after price sweeps and closes back inside, aligning with the BOS direction
The EA is built with a performance-oriented engine (cached rates, bar-based processing), risk controls, and broker constraint checks to reduce rejected orders.
Strategy Logic
Swing & Structure Detection
- Uses a configurable SwingLength (bars left/right) to label swing points:
- Highs: H / HH / LH
- Lows: L / LL / HL
- Confirms BOS only after a close breaks the prior structure level.
Liquidity Sweep Entry
After BOS is confirmed, the EA targets the opposite liquidity pool:
- Bullish BOS → SSL Sweep Buy
- Price wicks below last swing low (liquidity), then closes back above
- Candle must be bullish (close > open)
- Bearish BOS → BSL Sweep Sell
- Price wicks above last swing high (liquidity), then closes back below
- Candle must be bearish (close < open)
The signal is “consumed” after entry to prevent repeated trades on the same setup.
Risk & Trade Execution
Stop Loss & Take Profit
- SL is placed beyond the sweep extremum with a configurable buffer (points).
- TP uses a fixed Risk:Reward ratio (RRR), default 2.0.
Position Sizing
Choose between:
- Fixed lot size, or
- Risk % per trade (lot size calculated from SL distance using tick size/value)
Broker & Safety Filters
- Max spread filter (in points)
- Stops / freeze level distance checks
- Compatible filling mode (FOK/IOC/RETURN)
- Configurable market order deviation
Trade Frequency Control
- Limits maximum open positions per symbol/magic number
- Cooldown bars after each trade
- Optional close opposite positions before opening a new one
Trade Management (RR-Based)
Optional advanced management features based on the initial “1R” distance:
- Break-even move after +X R (with BE offset)
- Partial close after +X R (one-time per position)
- RR-based trailing stop after +X R, keeping SL a set fraction of R behind price
Visualization (Optional)
If enabled, the EA draws:
- Swing point markers and labels (H/HH/LH, L/LL/HL)
- BOS levels (dashed structure break line)
- Liquidity sweep zones (SSL/BSL rectangles + level line)
- Entry arrows
Also includes automatic pruning of older objects to keep charts clean.
Optimizer Toolkit (Included)
Built-in professional optimization scoring:
- Outputs one CSV per optimization run
- Composite score based on MT5 tester stats (PF, Recovery, DD%, Expected Payoff, Win↔RRR harmony, Smoothness)
- Optional strict gating to reject brittle parameter sets (min trades, max DD%, min PF)
Inputs Overview
Key inputs include:
- SwingLength, RiskRewardRatio, SL buffer
- Spread filter, deviation, max trades, cooldown
- Risk% sizing or fixed lots
- Break-even / trailing / partial close toggles
- Visual toggles and object pruning
- Optimization CSV + scoring parameters
Recommended Usage
- Best used on liquid FX majors, gold, and major indices (depending on broker conditions).
- Perform Strategy Tester optimizations per symbol + timeframe, and validate with forward testing.
- Keep spread filter enabled for cleaner executions during volatile sessions.
Important Notes / Disclaimer
This EA is a systematic trading tool. Results depend on symbol, broker execution, spread, and market regime. Always test on a demo account before live trading. No strategy guarantees profits.
