Smart liquidity sweep Trap Detector
- Indicators
-
Thomas Edelbroek
Trading since 2016 and interested in automated trading since the end of 2016. Started my own business 'Startenmettraden.nl' and start-with-trading.com' to help others to succeed in trading as well. - Version: 1.0
- Activations: 5
Smart Money Trap Detector identifies liquidity traps at swing highs and swing lows. It detects when price sweeps beyond a key level and reverses back, signaling a potential bull trap or bear trap set by institutional players. Each detected trap receives a strength score from 1 to 5 based on wick size, reversal speed and volume.
How it works
The indicator tracks swing highs and swing lows using a configurable lookback period. When price breaks above a swing high or below a swing low, the indicator monitors for a reversal back through the level within a set number of confirmation candles. If the breakout wick meets the minimum ATR ratio threshold and price closes back inside the range, a trap is confirmed. The trap score is calculated from three factors: wick size relative to ATR (how far price overshot), reversal speed (how quickly price returned), and volume spike (whether the breakout bar had above-average volume). All signals are placed on the confirmed closed bar to prevent repainting.
Visual Features
Arrows on the chart mark each confirmed bull trap (up arrow) and bear trap (down arrow). Liquidity zones are drawn as colored rectangles around swing highs and swing lows, showing where stop-loss clusters are likely located. Text labels display the trap type and strength score directly on the chart. A compact dashboard panel in the corner shows the last 10 detected traps with their type, score and how many bars ago they occurred.
Alert System
Real-time alerts fire when a new trap is confirmed. Alerts include the symbol, timeframe, trap type, strength score and current price. Both popup alerts and push notifications are supported.
Trap Score Explained
Each trap receives a score from 1 to 5. Score 1-2: Minor trap with a small wick and slow reversal. Score 3: Moderate trap with a clear wick and reasonable reversal speed. Score 4-5: Strong trap with a large wick relative to ATR, fast reversal and a volume spike. Higher scores indicate a higher probability that institutional players engineered the liquidity sweep.
Input Parameters
InpSwingLookback (default 5): Number of bars on each side required to confirm a swing high or swing low. Higher values detect more significant levels but produce fewer signals. InpConfirmCandles (default 3): Maximum number of bars after the sweep for price to close back inside the level. Lower values require faster reversals. InpMinWickAtrRatio (default 0.5): Minimum wick size as a ratio of ATR. Filters out minor wicks that may not represent genuine sweeps. InpAtrLength (default 14): ATR calculation period. InpShowZones: Toggle liquidity zone rectangles. InpShowDashboard: Toggle the trap history panel. InpShowLabels: Toggle trap text labels on the chart. InpEnableAlerts: Toggle popup and push notification alerts. InpBullTrapColor, InpBearTrapColor: Arrow and label colors. InpBullZoneColor, InpBearZoneColor: Liquidity zone rectangle colors.
Recommended Settings
Works on all timeframes. M15 to H4 typically produces the most actionable signals. Default settings are optimized for forex majors. For gold or indices, consider increasing InpSwingLookback to 7-10 and InpMinWickAtrRatio to 0.7 for stronger trap filtering. Use the trap score as a filter: focus on score 3 and above for higher-quality setups.
Important Notes
This indicator does not repaint. Signals are confirmed only after the bar has closed. The indicator detects potential trap patterns and does not guarantee trade outcomes. Use it as part of a broader trading strategy. Past pattern occurrence does not guarantee future results.
