OPEN-SOURCE SCRIPT
Smart Money Stop Hunt Detector [algo_aakash]

Smart Money Stop Hunt Detector is a liquidity sweep and rejection analysis tool designed to identify situations where price temporarily moves beyond recent swing highs or swing lows before quickly returning back inside the prior range.
The indicator focuses on identifying potential stop hunt events by combining liquidity sweep detection with displacement and volume validation. Rather than marking every breakout beyond a swing level, the script requires evidence of rejection before a signal is generated.
The goal is to help traders visualize areas where liquidity may have been taken from obvious swing points and where price subsequently failed to maintain acceptance beyond those levels.
Methodology
The script continuously tracks recent swing highs and swing lows using a user-defined lookback period.
These swing points are treated as potential liquidity pools because they often attract breakout entries, stop-loss orders, and resting liquidity.
A stop hunt event is identified when:
1. Price exceeds a recent liquidity level.
2. Price fails to remain beyond that level.
3. The candle closes back inside the previous range.
4. The rejection exceeds a minimum ATR-based displacement threshold.
5. Optional volume confirmation requirements are satisfied.
By requiring both a sweep and a rejection, the indicator attempts to filter out ordinary breakouts and focus on failed expansion moves.
Bullish Stop Hunt Detection
A bullish stop hunt occurs when:
• Price trades below a recent swing low.
• Price closes back above that swing low.
• The distance between the low and the close exceeds the minimum ATR displacement requirement.
• Optional volume confirmation passes.
This sequence may indicate that sell-side liquidity below the swing low was swept before price returned into the previous trading range.
Bearish Stop Hunt Detection
A bearish stop hunt occurs when:
• Price trades above a recent swing high.
• Price closes back below that swing high.
• The distance between the high and the close exceeds the minimum ATR displacement requirement.
• Optional volume confirmation passes.
This sequence may indicate that buy-side liquidity above the swing high was swept before price returned into the previous trading range.
ATR-Based Displacement Filter
One challenge with liquidity sweep detection is that many swing levels are breached by only a few ticks before price continues normally.
To reduce insignificant signals, the indicator includes an ATR-based displacement filter.
The rejection portion of the candle must exceed a user-defined percentage of Average True Range before the event is considered a valid stop hunt.
This allows the script to focus on stronger rejection candles rather than minor price fluctuations.
Volume Confirmation
An optional volume filter can be enabled to require participation above average volume levels.
The current volume is compared against a moving average of volume multiplied by a user-defined threshold.
This filter can help remove sweep events that occur during unusually low participation.
Liquidity Rejection Zones
When a valid stop hunt is detected, the indicator can create a liquidity rejection zone.
These zones extend forward on the chart and represent the area where the rejection occurred.
The purpose of these zones is to preserve market context and allow traders to monitor future interaction with previously rejected liquidity areas.
Zones are automatically removed if price invalidates the rejection structure.
Inputs
Detection Settings
**Liquidity Swing Length**
Determines the lookback period used to identify recent swing highs and swing lows.
**ATR Length**
Controls the ATR calculation period used by the displacement filter.
**Minimum Displacement ATR**
Defines the minimum rejection distance required for a valid stop hunt event.
Volume Filter
**Use Volume Confirmation**
Enables or disables volume validation.
**Volume MA Length**
Defines the moving average period used for volume comparison.
**Volume Threshold**
Specifies the volume multiplier required for confirmation.
Zone Settings
**Show Liquidity Rejection Zones**
Displays rejection zones on the chart.
**Zone Extension Bars**
Controls how far zones extend into future bars.
Alerts
Built-in alert conditions are available for:
• Bullish Stop Hunt
• Bearish Stop Hunt
• Any Stop Hunt Event
These alerts can be connected to TradingView notifications or external workflows.
Practical Usage
The indicator is intended as a market structure and liquidity analysis tool rather than a standalone trading system.
Many traders use liquidity sweep events together with:
• Market structure analysis
• Support and resistance levels
• Trend analysis
• Volume studies
• Higher timeframe context
The strongest signals often occur near significant swing points, established ranges, or key structural levels.
Limitations
The indicator identifies completed sweep and rejection events and does not predict future market direction.
Not every liquidity sweep leads to a reversal or continuation move.
Volume-based filtering may be less reliable on instruments with limited or synthetic volume data.
High-volatility conditions may produce additional sweep events.
Notes
This script is intended for educational and analytical purposes.
The concepts of liquidity sweeps, stop hunts, and rejection events are interpretation-based market structure concepts. The indicator should be used as a chart analysis tool and not as financial or investment advice.
The indicator focuses on identifying potential stop hunt events by combining liquidity sweep detection with displacement and volume validation. Rather than marking every breakout beyond a swing level, the script requires evidence of rejection before a signal is generated.
The goal is to help traders visualize areas where liquidity may have been taken from obvious swing points and where price subsequently failed to maintain acceptance beyond those levels.
Methodology
The script continuously tracks recent swing highs and swing lows using a user-defined lookback period.
These swing points are treated as potential liquidity pools because they often attract breakout entries, stop-loss orders, and resting liquidity.
A stop hunt event is identified when:
1. Price exceeds a recent liquidity level.
2. Price fails to remain beyond that level.
3. The candle closes back inside the previous range.
4. The rejection exceeds a minimum ATR-based displacement threshold.
5. Optional volume confirmation requirements are satisfied.
By requiring both a sweep and a rejection, the indicator attempts to filter out ordinary breakouts and focus on failed expansion moves.
Bullish Stop Hunt Detection
A bullish stop hunt occurs when:
• Price trades below a recent swing low.
• Price closes back above that swing low.
• The distance between the low and the close exceeds the minimum ATR displacement requirement.
• Optional volume confirmation passes.
This sequence may indicate that sell-side liquidity below the swing low was swept before price returned into the previous trading range.
Bearish Stop Hunt Detection
A bearish stop hunt occurs when:
• Price trades above a recent swing high.
• Price closes back below that swing high.
• The distance between the high and the close exceeds the minimum ATR displacement requirement.
• Optional volume confirmation passes.
This sequence may indicate that buy-side liquidity above the swing high was swept before price returned into the previous trading range.
ATR-Based Displacement Filter
One challenge with liquidity sweep detection is that many swing levels are breached by only a few ticks before price continues normally.
To reduce insignificant signals, the indicator includes an ATR-based displacement filter.
The rejection portion of the candle must exceed a user-defined percentage of Average True Range before the event is considered a valid stop hunt.
This allows the script to focus on stronger rejection candles rather than minor price fluctuations.
Volume Confirmation
An optional volume filter can be enabled to require participation above average volume levels.
The current volume is compared against a moving average of volume multiplied by a user-defined threshold.
This filter can help remove sweep events that occur during unusually low participation.
Liquidity Rejection Zones
When a valid stop hunt is detected, the indicator can create a liquidity rejection zone.
These zones extend forward on the chart and represent the area where the rejection occurred.
The purpose of these zones is to preserve market context and allow traders to monitor future interaction with previously rejected liquidity areas.
Zones are automatically removed if price invalidates the rejection structure.
Inputs
Detection Settings
**Liquidity Swing Length**
Determines the lookback period used to identify recent swing highs and swing lows.
**ATR Length**
Controls the ATR calculation period used by the displacement filter.
**Minimum Displacement ATR**
Defines the minimum rejection distance required for a valid stop hunt event.
Volume Filter
**Use Volume Confirmation**
Enables or disables volume validation.
**Volume MA Length**
Defines the moving average period used for volume comparison.
**Volume Threshold**
Specifies the volume multiplier required for confirmation.
Zone Settings
**Show Liquidity Rejection Zones**
Displays rejection zones on the chart.
**Zone Extension Bars**
Controls how far zones extend into future bars.
Alerts
Built-in alert conditions are available for:
• Bullish Stop Hunt
• Bearish Stop Hunt
• Any Stop Hunt Event
These alerts can be connected to TradingView notifications or external workflows.
Practical Usage
The indicator is intended as a market structure and liquidity analysis tool rather than a standalone trading system.
Many traders use liquidity sweep events together with:
• Market structure analysis
• Support and resistance levels
• Trend analysis
• Volume studies
• Higher timeframe context
The strongest signals often occur near significant swing points, established ranges, or key structural levels.
Limitations
The indicator identifies completed sweep and rejection events and does not predict future market direction.
Not every liquidity sweep leads to a reversal or continuation move.
Volume-based filtering may be less reliable on instruments with limited or synthetic volume data.
High-volatility conditions may produce additional sweep events.
Notes
This script is intended for educational and analytical purposes.
The concepts of liquidity sweeps, stop hunts, and rejection events are interpretation-based market structure concepts. The indicator should be used as a chart analysis tool and not as financial or investment advice.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Build your trading tools with AI : algotim.com
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Build your trading tools with AI : algotim.com
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
All content provided by AlgoTim (algo_aakash) is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.