OPEN-SOURCE SCRIPT
Smart Liquidity V4

# Smart Liquidity V4 - Optimal Few Entry Strategy
## 📌 Overview
This indicator is designed to identify **few but high-probability** entries using the logic: **Sweep → CHoCH → Retest → Strict Confirm**.
---
## 🎯 Core Logic
### 1. **Liquidity Detection**
- Identifies buy/sell liquidity levels using pivot high/low
- Determines the nearest liquidity level
- Tracks whether liquidity has been swept
### 2. **Structure Analysis**
- Marks HH/HL (Higher High / Higher Low) and LH/LL (Lower High / Lower Low)
- Identifies BOS (Break of Structure)
- Identifies CHoCH (Change of Character - trend reversal)
### 3. **Entry Logic Flow**
```
Sweep (Liquidity taken)
↓
CHoCH (Trend change confirmed)
↓
Retest (Price returns to confirm)
↓
Strict Confirm (Ultra strict candle confirmation)
↓
ENTRY (1:3 FIXED)
```
### 4. **Confirmation Rules (ULTRA STRICT Mode)**
- Bull/Bear engulfing candle pattern
- Body size > 1.25x of average body
- Close > previous high / < previous low
- Body size > 1.2x of average body
### 5. **Risk Management**
- **Fixed 1:3** Risk/Reward ratio
- SL placed at ATR * 0.8 distance
- TP calculated based on 1:3 ratio
---
## ⚙️ Settings
### 📊 LIQUIDITY
| Parameter | Default | Description |
|-----------|---------|-------------|
| Left Bars | 5 | Number of bars to the left |
| Right Bars | 5 | Number of bars to the right |
| Max Age | 500 | How long to keep liquidity levels |
| Min Fresh Bars | 25 | Minimum age requirement for fresh liquidity |
### 🏗️ STRUCTURE
| Parameter | Default | Description |
|-----------|---------|-------------|
| Left | 5 | Structure left bars |
| Right | 5 | Structure right bars |
| Lookback | 25 | Lookback period for BOS/CHoCH |
| ATR Filter | 0.12 | ATR filter multiplier |
### 🕯️ CONFIRMATION
| Parameter | Default | Description |
|-----------|---------|-------------|
| Confirm Mode | ULTRA STRICT | Confirmation mode |
| Body > SMA* | 1.25 | Body size multiplier |
| RSI Filter | ON | Use RSI filter |
| EMA 50/200 Filter | ON | Use EMA trend filter |
### 🚀 ENTRIES
| Parameter | Default | Description |
|-----------|---------|-------------|
| Entry Mode | Reversal (High WR) | Entry mode selection |
| Sweep→CHoCH max | 10 | Max bars from Sweep to CHoCH |
| CHoCH→Confirm max | 8 | Max bars from CHoCH to Confirm |
| Cooldown | 40 | Wait time between entries |
| Min Prob % | 55 | Minimum probability threshold |
### ⚖️ RISK
| Parameter | Default | Description |
|-----------|---------|-------------|
| FIXED 1:3 | 3.0 | Fixed RR ratio |
| SL ATR Buffer | 0.8 | SL ATR multiplier |
---
## 🎨 Visual Elements
### Displayed:
- **Structure Labels**: HH, HL, LH, LL, BOS, CHoCH
- **Entry Signals**: LONG/SHORT signals on chart
- **Entry/SL/TP Lines**: Last entry levels (visible for 200 bars)
- **Info Table**: W/L count and WinRate
### Hidden (Removed):
- ❌ Liquidity lines
- ❌ Position boxes
- ❌ Large panels
---
## 📈 Statistics Tracked
The indicator tracks:
- **Total Trades** count
- **Wins/Losses** count
- **WinRate %** = Wins / (Wins + Losses) * 100
- **Best Win/Loss Streak**
- **Last Result** (WIN/LOSS)
---
## 🔔 Alerts
Two alert conditions available:
1. `OPTIMAL LONG 1:3` - Buy signal
2. `OPTIMAL SHORT 1:3` - Sell signal
---
## 💡 Recommendations
### To Get Fewer Entries:
- Increase `Cooldown`: 40 → 60
- Increase `Min Prob %`: 55 → 65
### To Get More Entries:
- Decrease `Cooldown`: 40 → 25
- Decrease `Min Prob %`: 55 → 50
### To Improve WinRate:
- Keep `ULTRA STRICT` mode
- Increase `Body > SMA*`: 1.25 → 1.5
- Increase `SL ATR Buffer`: 0.8 → 1.0
---
## 📝 Notes
- This indicator is designed for **few but high-quality** entries
- Should generate only 1-3 entries per day (market dependent)
- 1:3 RR is fixed but adjustable
- Works profitably when WinRate is 55%+
## 📌 Overview
This indicator is designed to identify **few but high-probability** entries using the logic: **Sweep → CHoCH → Retest → Strict Confirm**.
---
## 🎯 Core Logic
### 1. **Liquidity Detection**
- Identifies buy/sell liquidity levels using pivot high/low
- Determines the nearest liquidity level
- Tracks whether liquidity has been swept
### 2. **Structure Analysis**
- Marks HH/HL (Higher High / Higher Low) and LH/LL (Lower High / Lower Low)
- Identifies BOS (Break of Structure)
- Identifies CHoCH (Change of Character - trend reversal)
### 3. **Entry Logic Flow**
```
Sweep (Liquidity taken)
↓
CHoCH (Trend change confirmed)
↓
Retest (Price returns to confirm)
↓
Strict Confirm (Ultra strict candle confirmation)
↓
ENTRY (1:3 FIXED)
```
### 4. **Confirmation Rules (ULTRA STRICT Mode)**
- Bull/Bear engulfing candle pattern
- Body size > 1.25x of average body
- Close > previous high / < previous low
- Body size > 1.2x of average body
### 5. **Risk Management**
- **Fixed 1:3** Risk/Reward ratio
- SL placed at ATR * 0.8 distance
- TP calculated based on 1:3 ratio
---
## ⚙️ Settings
### 📊 LIQUIDITY
| Parameter | Default | Description |
|-----------|---------|-------------|
| Left Bars | 5 | Number of bars to the left |
| Right Bars | 5 | Number of bars to the right |
| Max Age | 500 | How long to keep liquidity levels |
| Min Fresh Bars | 25 | Minimum age requirement for fresh liquidity |
### 🏗️ STRUCTURE
| Parameter | Default | Description |
|-----------|---------|-------------|
| Left | 5 | Structure left bars |
| Right | 5 | Structure right bars |
| Lookback | 25 | Lookback period for BOS/CHoCH |
| ATR Filter | 0.12 | ATR filter multiplier |
### 🕯️ CONFIRMATION
| Parameter | Default | Description |
|-----------|---------|-------------|
| Confirm Mode | ULTRA STRICT | Confirmation mode |
| Body > SMA* | 1.25 | Body size multiplier |
| RSI Filter | ON | Use RSI filter |
| EMA 50/200 Filter | ON | Use EMA trend filter |
### 🚀 ENTRIES
| Parameter | Default | Description |
|-----------|---------|-------------|
| Entry Mode | Reversal (High WR) | Entry mode selection |
| Sweep→CHoCH max | 10 | Max bars from Sweep to CHoCH |
| CHoCH→Confirm max | 8 | Max bars from CHoCH to Confirm |
| Cooldown | 40 | Wait time between entries |
| Min Prob % | 55 | Minimum probability threshold |
### ⚖️ RISK
| Parameter | Default | Description |
|-----------|---------|-------------|
| FIXED 1:3 | 3.0 | Fixed RR ratio |
| SL ATR Buffer | 0.8 | SL ATR multiplier |
---
## 🎨 Visual Elements
### Displayed:
- **Structure Labels**: HH, HL, LH, LL, BOS, CHoCH
- **Entry Signals**: LONG/SHORT signals on chart
- **Entry/SL/TP Lines**: Last entry levels (visible for 200 bars)
- **Info Table**: W/L count and WinRate
### Hidden (Removed):
- ❌ Liquidity lines
- ❌ Position boxes
- ❌ Large panels
---
## 📈 Statistics Tracked
The indicator tracks:
- **Total Trades** count
- **Wins/Losses** count
- **WinRate %** = Wins / (Wins + Losses) * 100
- **Best Win/Loss Streak**
- **Last Result** (WIN/LOSS)
---
## 🔔 Alerts
Two alert conditions available:
1. `OPTIMAL LONG 1:3` - Buy signal
2. `OPTIMAL SHORT 1:3` - Sell signal
---
## 💡 Recommendations
### To Get Fewer Entries:
- Increase `Cooldown`: 40 → 60
- Increase `Min Prob %`: 55 → 65
### To Get More Entries:
- Decrease `Cooldown`: 40 → 25
- Decrease `Min Prob %`: 55 → 50
### To Improve WinRate:
- Keep `ULTRA STRICT` mode
- Increase `Body > SMA*`: 1.25 → 1.5
- Increase `SL ATR Buffer`: 0.8 → 1.0
---
## 📝 Notes
- This indicator is designed for **few but high-quality** entries
- Should generate only 1-3 entries per day (market dependent)
- 1:3 RR is fixed but adjustable
- Works profitably when WinRate is 55%+
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.