OPEN-SOURCE SCRIPT
Sweep Reversal Map+ [Herman]

Sweep Reversal Map [Herman]
Sweep Reversal Map [Herman] is an open-source price-action indicator designed to identify potential reversal areas that develop after price sweeps previously confirmed swing liquidity.
The concept is inspired by liquidity-sweep and reversal principles taught within ICT methodology, including the idea that price can trade beyond a prior swing high or swing low, reclaim that liquidity level, and subsequently confirm a reversal through a break of nearby market structure.
This script provides an independent Pine Script implementation of that general concept with configurable swing detection, sweep penetration, structure confirmation, displacement filtering, developing zones, and historical reversal mapping.
HOW IT WORKS
The indicator follows a multi-stage process rather than marking every wick through a previous high or low.
1. Confirmed Swing Liquidity
The script first identifies confirmed swing highs and swing lows using the selected Swing Length.
These levels represent previously established areas of liquidity that price may later sweep.
2. Liquidity Sweep
A bearish reversal candidate begins when price trades above a confirmed swing high.
A bullish reversal candidate begins when price trades below a confirmed swing low.
The Minimum Sweep Penetration setting can optionally require price to move a specified ATR-based distance beyond the liquidity level before the event qualifies as a sweep.
3. Reclaim
After the sweep occurs, the script tracks whether price closes back through the swept liquidity level.
For a bearish setup, price must reclaim below the swept swing high.
For a bullish setup, price must reclaim above the swept swing low.
4. Local Structure Confirmation
A sweep alone does not create a confirmed reversal.
The script records nearby structure preceding the sweep and waits for price to break that structure in the opposite direction.
A bearish reversal requires a close below the relevant local structure level.
A bullish reversal requires a close above the relevant local structure level.
5. Displacement Filter
The confirmation candle can also be required to show a minimum body size relative to ATR.
This provides an optional displacement requirement and helps distinguish stronger confirmation candles from very small structure breaks.
Setting Minimum Displacement Body to 0 disables this filter.
REVERSAL ZONES
When Show Developing Reversals is enabled, a faint zone represents a sweep that has occurred but has not yet completed the full confirmation process.
The zone expands if price creates a more extreme price during the developing setup.
Once all confirmation conditions are satisfied, the zone becomes visually stronger and is retained as a historical confirmed sweep-reversal area.
If confirmation does not occur within the selected Maximum Confirmation Bars, the developing setup expires and is removed.
HOW TO INTERPRET THE MAP
A zone above price represents a confirmed bearish sweep-reversal event originating from liquidity above a previous swing high.
A zone below price represents a confirmed bullish sweep-reversal event originating from liquidity below a previous swing low.
The horizontal line identifies the liquidity level associated with the sweep.
The marker identifies the original confirmed swing from which that liquidity level was derived.
These areas are intended to provide additional price-action context. They are not automatic long or short entries and should not be interpreted as guaranteed reversal points.
SETTINGS
Swing Length
Controls how many bars on each side are required to confirm a swing. Higher values generally identify less frequent but more significant swing points.
ATR Length
Defines the ATR period used by the penetration and displacement filters.
Minimum Sweep Penetration
Determines how far beyond the swing level price must trade for the event to qualify as a sweep. A value of 0 accepts any breach.
Local Structure Length
Controls the number of preceding bars used to determine the local structure level required for reversal confirmation.
Maximum Confirmation Bars
Defines how long a developing sweep can remain active while waiting for confirmation.
Minimum Displacement Body
Requires the confirmation candle body to reach a selected fraction of ATR. A value of 0 disables the displacement requirement.
Show Developing Reversals
Displays or hides unconfirmed sweep zones while they are developing.
Confirmed Box Extension
Controls how far confirmed reversal zones extend to the right.
Historical Setups
Controls the maximum number of confirmed historical setups retained on the chart.
IMPORTANT BEHAVIOR OF SWING DETECTION
Swing highs and swing lows are confirmed only after the required number of bars has formed to the right of the potential pivot.
For example, with a Swing Length of 5, a potential swing requires five subsequent bars before it can become a confirmed liquidity level.
Once confirmed, the level is visually anchored to the bar where the swing originally occurred. This historical placement should not be interpreted as the indicator having known the swing in real time on that original bar.
A sweep can only be detected after the corresponding swing has already been confirmed.
Signals and confirmation logic are evaluated on confirmed bars.
LIMITATIONS
Liquidity sweeps and structure breaks are price-action events, not guarantees that price will continue reversing.
Different markets and timeframes can produce very different amounts of noise and therefore may require different Swing Length, structure, penetration, and displacement settings.
A developing reversal can disappear if the required confirmation does not occur before the confirmation window expires.
The indicator does not calculate expected returns, win rates, profit targets, stop-loss levels, or strategy performance.
It should therefore be used as a market-structure visualization and research tool rather than as a standalone trading system.
ORIGINAL IMPLEMENTATION
The underlying liquidity-sweep/reversal concept is an established price-action concept and is associated here with ICT educational methodology.
The original contribution of this script is its programmatic implementation and visualization workflow: confirmed swing-liquidity tracking, optional ATR-normalized sweep penetration, reclaim state tracking, local-structure confirmation, ATR-normalized displacement confirmation, developing setup management, expiration logic, configurable historical reversal zones, and confirmation alerts.
The source code is published openly so users can inspect how each condition is calculated and modify the implementation for their own research.
Sweep Reversal Map [Herman] is an open-source price-action indicator designed to identify potential reversal areas that develop after price sweeps previously confirmed swing liquidity.
The concept is inspired by liquidity-sweep and reversal principles taught within ICT methodology, including the idea that price can trade beyond a prior swing high or swing low, reclaim that liquidity level, and subsequently confirm a reversal through a break of nearby market structure.
This script provides an independent Pine Script implementation of that general concept with configurable swing detection, sweep penetration, structure confirmation, displacement filtering, developing zones, and historical reversal mapping.
HOW IT WORKS
The indicator follows a multi-stage process rather than marking every wick through a previous high or low.
1. Confirmed Swing Liquidity
The script first identifies confirmed swing highs and swing lows using the selected Swing Length.
These levels represent previously established areas of liquidity that price may later sweep.
2. Liquidity Sweep
A bearish reversal candidate begins when price trades above a confirmed swing high.
A bullish reversal candidate begins when price trades below a confirmed swing low.
The Minimum Sweep Penetration setting can optionally require price to move a specified ATR-based distance beyond the liquidity level before the event qualifies as a sweep.
3. Reclaim
After the sweep occurs, the script tracks whether price closes back through the swept liquidity level.
For a bearish setup, price must reclaim below the swept swing high.
For a bullish setup, price must reclaim above the swept swing low.
4. Local Structure Confirmation
A sweep alone does not create a confirmed reversal.
The script records nearby structure preceding the sweep and waits for price to break that structure in the opposite direction.
A bearish reversal requires a close below the relevant local structure level.
A bullish reversal requires a close above the relevant local structure level.
5. Displacement Filter
The confirmation candle can also be required to show a minimum body size relative to ATR.
This provides an optional displacement requirement and helps distinguish stronger confirmation candles from very small structure breaks.
Setting Minimum Displacement Body to 0 disables this filter.
REVERSAL ZONES
When Show Developing Reversals is enabled, a faint zone represents a sweep that has occurred but has not yet completed the full confirmation process.
The zone expands if price creates a more extreme price during the developing setup.
Once all confirmation conditions are satisfied, the zone becomes visually stronger and is retained as a historical confirmed sweep-reversal area.
If confirmation does not occur within the selected Maximum Confirmation Bars, the developing setup expires and is removed.
HOW TO INTERPRET THE MAP
A zone above price represents a confirmed bearish sweep-reversal event originating from liquidity above a previous swing high.
A zone below price represents a confirmed bullish sweep-reversal event originating from liquidity below a previous swing low.
The horizontal line identifies the liquidity level associated with the sweep.
The marker identifies the original confirmed swing from which that liquidity level was derived.
These areas are intended to provide additional price-action context. They are not automatic long or short entries and should not be interpreted as guaranteed reversal points.
SETTINGS
Swing Length
Controls how many bars on each side are required to confirm a swing. Higher values generally identify less frequent but more significant swing points.
ATR Length
Defines the ATR period used by the penetration and displacement filters.
Minimum Sweep Penetration
Determines how far beyond the swing level price must trade for the event to qualify as a sweep. A value of 0 accepts any breach.
Local Structure Length
Controls the number of preceding bars used to determine the local structure level required for reversal confirmation.
Maximum Confirmation Bars
Defines how long a developing sweep can remain active while waiting for confirmation.
Minimum Displacement Body
Requires the confirmation candle body to reach a selected fraction of ATR. A value of 0 disables the displacement requirement.
Show Developing Reversals
Displays or hides unconfirmed sweep zones while they are developing.
Confirmed Box Extension
Controls how far confirmed reversal zones extend to the right.
Historical Setups
Controls the maximum number of confirmed historical setups retained on the chart.
IMPORTANT BEHAVIOR OF SWING DETECTION
Swing highs and swing lows are confirmed only after the required number of bars has formed to the right of the potential pivot.
For example, with a Swing Length of 5, a potential swing requires five subsequent bars before it can become a confirmed liquidity level.
Once confirmed, the level is visually anchored to the bar where the swing originally occurred. This historical placement should not be interpreted as the indicator having known the swing in real time on that original bar.
A sweep can only be detected after the corresponding swing has already been confirmed.
Signals and confirmation logic are evaluated on confirmed bars.
LIMITATIONS
Liquidity sweeps and structure breaks are price-action events, not guarantees that price will continue reversing.
Different markets and timeframes can produce very different amounts of noise and therefore may require different Swing Length, structure, penetration, and displacement settings.
A developing reversal can disappear if the required confirmation does not occur before the confirmation window expires.
The indicator does not calculate expected returns, win rates, profit targets, stop-loss levels, or strategy performance.
It should therefore be used as a market-structure visualization and research tool rather than as a standalone trading system.
ORIGINAL IMPLEMENTATION
The underlying liquidity-sweep/reversal concept is an established price-action concept and is associated here with ICT educational methodology.
The original contribution of this script is its programmatic implementation and visualization workflow: confirmed swing-liquidity tracking, optional ATR-normalized sweep penetration, reclaim state tracking, local-structure confirmation, ATR-normalized displacement confirmation, developing setup management, expiration logic, configurable historical reversal zones, and confirmation alerts.
The source code is published openly so users can inspect how each condition is calculated and modify the implementation for their own research.
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.
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.
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.