OPEN-SOURCE SCRIPT
Reversal SMC/ICT Edition

Reversal — SMC/ICT Edition
**Original concept by © HasanRifat — Extended & rebuilt for SMC/ICT confluence trading**
---
### Overview
This is a fully reworked version of HasanRifat's original Reversal indicator, rebuilt from the ground up to address its core structural weaknesses and align with a serious SMC/ICT trading framework. The original logic was sound — but it fired signals without trend context, volume conviction, or session awareness. This version fixes all of that.
The result is a precision **liquidity sweep + displacement detector** that gates every signal through five confluent layers before plotting. Fewer signals. Higher quality.
---
### What The Indicator Actually Detects
The core pattern this indicator hunts is a two-step sequence that SMC/ICT traders will immediately recognise:
**Step 1 — The Sweep**
A candle closes below the lows (or above the highs) of a configurable percentage of recent candles. This is a programmatic representation of a **BSL/SSL liquidity grab** — price reaching down to where stop losses and buy/sell orders are clustered, then preparing to reverse.
**Step 2 — The Reclaim (Confirmation)**
Within a tight confirmation window (default 3 bars), price closes back above the sweep candle's high (bullish) or below its low (bearish). This is the **displacement** — the market maker move away from the liquidity pool. Without this reclaim happening quickly, the setup is invalidated.
This two-step sequence maps directly onto the **sweep → displacement → BOS** structure that underpins ICT-based entry models.
---
### Five-Layer Signal Gate
Every signal must pass all active filters simultaneously before plotting:
**Layer 1 — Flexible Sweep Threshold**
The original indicator required *exactly* `lookback - 1` candles to be swept — a rigid rule that missed perfectly valid setups by one candle. This version uses a percentage-based threshold (default 85%). At lookback 20, this means 17 out of 20 prior candles must have their low (or high) breached. Tighten toward 1.0 for stricter sweeps, loosen toward 0.75 to catch more setups. The threshold is tunable without breaking the logic.
**Layer 2 — HTF Trend Filter**
A higher timeframe EMA (default: 1H, 50 EMA) gates the signal direction. Bullish reversals only fire when HTF close is above the HTF EMA. Bearish reversals only fire when below. Trading reversals against the HTF trend is where the majority of retail losses come from — this filter eliminates that entire category of setups. The HTF EMA is plotted directly on chart as a colour-coded ribbon (green above, red below) so bias is always visually obvious.
**Layer 3 — Volume Displacement Confirmation**
The confirming candle's volume must exceed the 20-bar volume moving average by a configurable multiplier (default 1.2× — 20% above average). A weak, low-volume close back above the sweep candle's high is not a displacement. It's noise. This filter requires the market to show actual conviction on the reclaim bar, consistent with genuine institutional participation.
**Layer 4 — Session Filter**
Signals only fire within a defined session window. Default is `0700–1630 UTC` (London open through New York close). This eliminates Asian session chop, pre-market fakes, and low-liquidity reversals that have no follow-through. The session window is fully customisable in settings.
**Layer 5 — Non-Repainting (Default ON)**
The single most common reason retail traders lose money on reversal indicators is repainting. The original indicator had non-repainting mode *off* by default, meaning backtests looked significantly better than live performance. This version has it **on by default**. All conditions are evaluated on the previous fully closed bar. What you see in history is exactly what would have fired in real time — no exceptions.
---
### Inputs Reference
| Parameter | Default | Description |
|---|---|---|
| Candle Lookback | 20 | Number of prior candles scanned for the sweep |
| Confirm Within | 3 | Max bars allowed for price to reclaim after sweep |
| Sweep Threshold % | 0.85 | % of lookback candles that must be breached |
| Non-Repainting Mode | ✅ ON | Signals based on closed bars only |
| Enable Trend Filter | ✅ ON | Gates signals by HTF EMA direction |
| HTF Timeframe | 60 (1H) | Timeframe for trend EMA calculation |
| Trend EMA Length | 50 | EMA length on HTF for bias determination |
| Enable Volume Filter | ✅ ON | Requires above-average volume on confirmation bar |
| Volume MA Length | 20 | Lookback for volume moving average |
| Min Volume Multiplier | 1.2 | Confirmation bar volume must exceed MA × this value |
| Enable Session Filter | ✅ ON | Restricts signals to defined trading hours |
| Session Window (UTC) | 0700-1630 | Active signal window |
---
### How To Use This In An SMC/ICT Framework
This indicator is designed as a **precision entry trigger**, not a standalone system. It performs best as the final confirmation layer in a structured top-down analysis:
1. **Establish HTF bias** on the 1H chart — is price in a bullish or bearish swing structure? The built-in trend filter enforces this, but your manual HTF read should come first.
2. **Identify premium/discount zones** — only look for bullish signals from discount, bearish from premium. The indicator fires in both directions; your zone analysis determines which signals are tradeable.
3. **Mark key liquidity pools** — EQH/EQL levels where BSL/SSL is resting. The sweep pattern is most powerful when it targets a known liquidity pool, not a random low.
4. **Wait for the signal** — when the lime triangle (bullish) or red triangle (bearish) appears, the sweep + reclaim + volume + trend + session conditions have all been met simultaneously.
5. **Drop to LTF for entry** — use a 1M BOS or CHoCH as final entry trigger. The signal on your execution timeframe marks the area; the 1M structure break marks the precise moment.
6. **Place entry at structure** — Fibonacci retracement of the displacement move, or the 50% of the confirming candle, depending on your model.
---
### What This Indicator Is Not
- It is **not** a complete trading system. No indicator is.
- It does **not** replace HTF structure analysis, premium/discount identification, or liquidity mapping.
- It does **not** account for high-impact news events. Manage your own news calendar.
- It will **not** fire on every valid setup — the five-layer gate is intentional. Missing a signal is better than taking a bad one.
---
### Alerts
Two alert conditions are included:
- `Bullish Reversal [SMC]` — fires when all bullish conditions are met
- `Bearish Reversal [SMC]` — fires when all bearish conditions are met
Set alerts on **Once Per Bar Close** to remain consistent with non-repainting mode.
---
### Credits
Core sweep detection logic based on the original **Reversal** indicator by © HasanRifat. Extended with trend, volume, session filtering and non-repainting defaults for professional SMC/ICT application.
---
*This indicator is a tool for analysis. All trading decisions remain your own responsibility. Past signal performance does not guarantee future results.*
**Original concept by © HasanRifat — Extended & rebuilt for SMC/ICT confluence trading**
---
### Overview
This is a fully reworked version of HasanRifat's original Reversal indicator, rebuilt from the ground up to address its core structural weaknesses and align with a serious SMC/ICT trading framework. The original logic was sound — but it fired signals without trend context, volume conviction, or session awareness. This version fixes all of that.
The result is a precision **liquidity sweep + displacement detector** that gates every signal through five confluent layers before plotting. Fewer signals. Higher quality.
---
### What The Indicator Actually Detects
The core pattern this indicator hunts is a two-step sequence that SMC/ICT traders will immediately recognise:
**Step 1 — The Sweep**
A candle closes below the lows (or above the highs) of a configurable percentage of recent candles. This is a programmatic representation of a **BSL/SSL liquidity grab** — price reaching down to where stop losses and buy/sell orders are clustered, then preparing to reverse.
**Step 2 — The Reclaim (Confirmation)**
Within a tight confirmation window (default 3 bars), price closes back above the sweep candle's high (bullish) or below its low (bearish). This is the **displacement** — the market maker move away from the liquidity pool. Without this reclaim happening quickly, the setup is invalidated.
This two-step sequence maps directly onto the **sweep → displacement → BOS** structure that underpins ICT-based entry models.
---
### Five-Layer Signal Gate
Every signal must pass all active filters simultaneously before plotting:
**Layer 1 — Flexible Sweep Threshold**
The original indicator required *exactly* `lookback - 1` candles to be swept — a rigid rule that missed perfectly valid setups by one candle. This version uses a percentage-based threshold (default 85%). At lookback 20, this means 17 out of 20 prior candles must have their low (or high) breached. Tighten toward 1.0 for stricter sweeps, loosen toward 0.75 to catch more setups. The threshold is tunable without breaking the logic.
**Layer 2 — HTF Trend Filter**
A higher timeframe EMA (default: 1H, 50 EMA) gates the signal direction. Bullish reversals only fire when HTF close is above the HTF EMA. Bearish reversals only fire when below. Trading reversals against the HTF trend is where the majority of retail losses come from — this filter eliminates that entire category of setups. The HTF EMA is plotted directly on chart as a colour-coded ribbon (green above, red below) so bias is always visually obvious.
**Layer 3 — Volume Displacement Confirmation**
The confirming candle's volume must exceed the 20-bar volume moving average by a configurable multiplier (default 1.2× — 20% above average). A weak, low-volume close back above the sweep candle's high is not a displacement. It's noise. This filter requires the market to show actual conviction on the reclaim bar, consistent with genuine institutional participation.
**Layer 4 — Session Filter**
Signals only fire within a defined session window. Default is `0700–1630 UTC` (London open through New York close). This eliminates Asian session chop, pre-market fakes, and low-liquidity reversals that have no follow-through. The session window is fully customisable in settings.
**Layer 5 — Non-Repainting (Default ON)**
The single most common reason retail traders lose money on reversal indicators is repainting. The original indicator had non-repainting mode *off* by default, meaning backtests looked significantly better than live performance. This version has it **on by default**. All conditions are evaluated on the previous fully closed bar. What you see in history is exactly what would have fired in real time — no exceptions.
---
### Inputs Reference
| Parameter | Default | Description |
|---|---|---|
| Candle Lookback | 20 | Number of prior candles scanned for the sweep |
| Confirm Within | 3 | Max bars allowed for price to reclaim after sweep |
| Sweep Threshold % | 0.85 | % of lookback candles that must be breached |
| Non-Repainting Mode | ✅ ON | Signals based on closed bars only |
| Enable Trend Filter | ✅ ON | Gates signals by HTF EMA direction |
| HTF Timeframe | 60 (1H) | Timeframe for trend EMA calculation |
| Trend EMA Length | 50 | EMA length on HTF for bias determination |
| Enable Volume Filter | ✅ ON | Requires above-average volume on confirmation bar |
| Volume MA Length | 20 | Lookback for volume moving average |
| Min Volume Multiplier | 1.2 | Confirmation bar volume must exceed MA × this value |
| Enable Session Filter | ✅ ON | Restricts signals to defined trading hours |
| Session Window (UTC) | 0700-1630 | Active signal window |
---
### How To Use This In An SMC/ICT Framework
This indicator is designed as a **precision entry trigger**, not a standalone system. It performs best as the final confirmation layer in a structured top-down analysis:
1. **Establish HTF bias** on the 1H chart — is price in a bullish or bearish swing structure? The built-in trend filter enforces this, but your manual HTF read should come first.
2. **Identify premium/discount zones** — only look for bullish signals from discount, bearish from premium. The indicator fires in both directions; your zone analysis determines which signals are tradeable.
3. **Mark key liquidity pools** — EQH/EQL levels where BSL/SSL is resting. The sweep pattern is most powerful when it targets a known liquidity pool, not a random low.
4. **Wait for the signal** — when the lime triangle (bullish) or red triangle (bearish) appears, the sweep + reclaim + volume + trend + session conditions have all been met simultaneously.
5. **Drop to LTF for entry** — use a 1M BOS or CHoCH as final entry trigger. The signal on your execution timeframe marks the area; the 1M structure break marks the precise moment.
6. **Place entry at structure** — Fibonacci retracement of the displacement move, or the 50% of the confirming candle, depending on your model.
---
### What This Indicator Is Not
- It is **not** a complete trading system. No indicator is.
- It does **not** replace HTF structure analysis, premium/discount identification, or liquidity mapping.
- It does **not** account for high-impact news events. Manage your own news calendar.
- It will **not** fire on every valid setup — the five-layer gate is intentional. Missing a signal is better than taking a bad one.
---
### Alerts
Two alert conditions are included:
- `Bullish Reversal [SMC]` — fires when all bullish conditions are met
- `Bearish Reversal [SMC]` — fires when all bearish conditions are met
Set alerts on **Once Per Bar Close** to remain consistent with non-repainting mode.
---
### Credits
Core sweep detection logic based on the original **Reversal** indicator by © HasanRifat. Extended with trend, volume, session filtering and non-repainting defaults for professional SMC/ICT application.
---
*This indicator is a tool for analysis. All trading decisions remain your own responsibility. Past signal performance does not guarantee future results.*
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.