Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.
Overview
Smart Liquidity Hunter v1.11 is a MetaTrader 4 indicator for identifying price sweeps around previously confirmed swing highs and lows. It uses OHLC prices as a liquidity proxy: it does not read actual resting orders or stop-loss locations, and it does not execute trades.
Signal rules
A bullish signal requires a closed candle to sweep below an eligible swing low and close back above it. A bearish signal requires a sweep above an eligible swing high followed by a close back below it.
The penetration must exceed the larger of the fixed points threshold and the volatility threshold. Volatility is calculated as the simple mean of true ranges from candles preceding the signal candle. The configured wick, closing-position, freshness and optional candle-direction filters must also pass.
Smooth out market noise with the Heiken Ashi Expert Advisor for MT4 and MT5. Reliable trend-following automation. Details here.
Only swings already confirmed before the signal candle are eligible. A candle qualifying in both directions is skipped. The unfinished candle does not receive a signal arrow.
Inputs and defaults
- SwingStrength = 3: Candles required on each side of a swing point.
- MaxSwingAge = 100: Maximum distance in bars from the signal candle to an eligible swing.
- MaxBarsToScan = 1000: Maximum number of closed historical candles calculated.
- MinSweepPoints = 12: Fixed sweep threshold in symbol points.
- VolatilityPeriod = 14: Lookback for the simple mean of preceding true ranges.
- MinSweepVolRatio = 0.10: Mean true range multiplier for the volatility-based sweep threshold.
- MinWickPercent = 25.0: Minimum rejection wick as a percentage of candle range: lower wick for bullish setups, upper wick for bearish setups.
- MinCloseLocationPct = 60.0: Minimum closing position measured from the low for bullish setups and from the high for bearish setups. At the default 60, bullish closes must lie within the upper 40% of the range and bearish closes within the lower 40%.
- RequireFreshLevel = true: Exclude levels previously pierced by an intervening candle.
- RequireCandleColor = false: When enabled, require close above open for bullish setups and close below open for bearish setups.
- ShowLiquidityLevels = true: Display eligible swing-high and swing-low levels.
- ShowDashboard = true: Display the chart information panel.
- ArrowPaddingPoints = 8: Minimum arrow offset from the candle high or low, in symbol points.
- ArrowOffsetVolRatio = 0.18: Mean true range multiplier for arrow spacing. The greater of this offset and ArrowPaddingPoints is used.
- DashboardInstanceId = A: Identifier of 1-40 characters. Each indicator instance on the same chart must use a different ID.
- DashboardTextColor = clrDodgerBlue: Dashboard text color.
- AlertPopup = false: Enable popup alerts for new closed-bar signals.
- AlertSound = false: Play alert.wav for new closed-bar signals.
- AlertPush = false: Enable push alerts; configure the terminal notification settings before use.
- DashboardX = 15: Dashboard distance from the chart's left edge, in pixels.
- DashboardY = 30: Dashboard distance from the chart's top edge, in pixels.
Chart examples
Green arrows mark bullish sweeps below the qualifying closed candle. Red arrows mark bearish sweeps above the qualifying closed candle. Dotted lines show eligible swing-high and swing-low levels.
The dashboard shows the latest eligible levels and most recent signal in the scanned history. A historical screenshot may therefore show an earlier signal than the dashboard's last-signal timestamp.

Figure 1. MT4, EURUSD H4: a historical bullish sweep signal.

Figure 2. MT4, EURUSD H4: a historical bearish sweep signal.
Usage notes
Start with the default inputs. Swing confirmation requires subsequent candles, so a swing is not available immediately when its high or low forms. Historical output depends on inputs, available price history and the calculation window.
Alerts are disabled by default. Initial attachment, history resets and catch-up batches do not trigger historical alerts. For multiple instances, use distinct DashboardInstanceId values, such as A and B, and different DashboardY positions.
User guide
For installation steps, detailed settings, chart examples and troubleshooting, see the Smart Liquidity Hunter user guide for MT4 and MT5.
Version 1.11
Dashboard object names now remain stable across profile reloads, preventing duplicate labels. Signal calculations are unchanged. A marked sweep does not establish that a reversal will follow.
Thanks for reading. Discover premium MetaTrader solutions at RobotFX.
79545