PROTECTED SOURCE SCRIPT
SMC Precision Scalper

# SMC Precision Scalper - All-in-One Smart Money Analysis Tool
## Overview
SMC Precision Scalper is a comprehensive technical analysis indicator combining Smart Money Concepts (SMC) methodology with advanced scalping tools. This indicator integrates institutional trading concepts to provide traders with high-probability confluence zones and market structure analysis.
---
## How It Works - Technical Methodology
### Order Block Detection System
**Detection Algorithm:**
The script identifies Order Blocks using a three-criteria validation process:
1. **Pattern Recognition**: Scans for consolidation candles (opposite color to trend) that precede strong impulse moves
2. **Impulse Validation**: The following candle must break the high/low of the consolidation candle
- Strict Mode: Impulse candle must fully engulf the Order Block
- Standard Mode: Impulse candle must only break the OB high/low
3. **Volatility Filtering**: Applies ATR (Average True Range) or CMR (Cumulative Mean Range) filters with adjustable multiplier (default 0.5x) to eliminate noise
**Mitigation Tracking:**
Order Blocks are monitored until price retraces to their 50% level (midpoint). Mitigation can be calculated by either:
- Close price crossing the midpoint
- Wick penetration of the midpoint
Internal Order Blocks use shorter swing length (default 5 periods) for intraday precision, while standard OBs use longer swings (default 10 periods) for structural zones.
---
### Fair Value Gap (FVG) Calculation
**Gap Detection:**
FVGs are identified when:
Bullish FVG: (candle.low - candle.high) > ATR(14) × threshold
Bearish FVG: (candle.low - candle.high) > ATR(14) × threshold
Default threshold: 0.3x ATR multiplier
**Visual Rendering:**
Each FVG is rendered as 13 horizontal layers to show the liquidity void depth. The script tracks consecutive FVGs to adjust layer positioning dynamically.
**Mitigation Logic:**
FVGs remain active until price fully crosses the gap zone (high > gap bottom AND low < gap top). Optionally displays "filled" FVGs with reduced opacity for historical reference.
---
### EMA Confluence & Flips System
**Core Components:**
- EMA Fast: 5-period exponential moving average
- EMA Slow: 12-period exponential moving average
- EMA Confluence: 200-period exponential moving average (customizable)
**Flip Detection:**
Generates signals when EMA 5 crosses EMA 12:
- Flip Up (↑): EMA 5 crosses above EMA 12
- Flip Down (↓): EMA 5 crosses under EMA 12
**Trend Filter:**
Optional confluence filter requires:
- Uptrend confirmation: Close > EMA Confluence for N bars (adjustable)
- Downtrend confirmation: Close < EMA Confluence for N bars
This prevents counter-trend signals and improves accuracy.
---
### EMA Cloud Layers
**Calculation:**
Creates three multi-timeframe cloud zones using paired EMAs:
- Cloud 1: EMA 20 / EMA 42
- Cloud 2: EMA 8 / EMA 23
- Cloud 3: EMA 5 / EMA 50
**Color Logic:**
- Green cloud: Faster EMA > Slower EMA (bullish momentum)
- Red cloud: Faster EMA < Slower EMA (bearish momentum)
Each cloud has progressive transparency (10%, 16%, 22%) to show momentum strength layers.
---
### VWAP Implementation
**Session VWAP:**
Calculates volume-weighted average price that resets at each session boundary using TradingView's native `ta.vwap()` function.
**Daily VWAP:**
Custom implementation that resets every calendar day:
CumulativePV = Σ(Price × Volume)
CumulativeV = Σ(Volume)
Daily VWAP = CumulativePV / CumulativeV
Source price options: HLC3, Close, OHLC4, HL2
---
### Premium/Discount Zones
**Range Calculation:**
Based on selected mode (Trailing Swings, Daily/Weekly/Monthly Range):
- High 100% = Swing high or HTF high
- Low 0% = Swing low or HTF low
- Range = High - Low
**Zone Division:**
*3 Zones Simple Mode:*
- Premium: 66.67% - 100%
- Equilibrium: 33.33% - 66.67%
- Discount: 0% - 33.33%
*5 Zones Fibonacci Mode:*
- Strong Premium: 78.6% - 100%
- Premium: 61.8% - 78.6% (OTE Zone)
- Equilibrium: 38.2% - 61.8%
- Discount: 23.6% - 38.2%
- Strong Discount: 0% - 23.6%
**Purpose:**
Provides institutional context: institutions typically buy in Discount zones and sell in Premium zones.
---
### Fibonacci Retracement
**Auto-Calculation:**
- Scans the last N periods (default 80, range 20-200) to identify swing high and swing low
- Projects key Fibonacci levels: 0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%
- Optional inversion for downtrends
- Future projection extends levels forward by adjustable bars (default 50)
**OTE Zone Highlighting:**
Creates a visual box for the 61.8%-78.6% zone, which represents the Optimal Trade Entry area commonly used in ICT methodology.
---
### Ichimoku Cloud (Multi-Timeframe)
**Components Calculation:**
Tenkan-sen = (9-period high + 9-period low) / 2
Kijun-sen = (26-period high + 26-period low) / 2
Senkou Span A = (Tenkan + Kijun) / 2
Senkou Span B = (52-period high + 52-period low) / 2
Chikou Span = Close shifted back 26 periods
**MTF Implementation:**
Uses `request.security()` to fetch higher timeframe data when custom timeframe is specified. Falls back to chart timeframe if empty.
**Cloud Filtering:**
- Price above cloud = Bullish bias filter
- Price below cloud = Bearish bias filter
- Price in cloud = Neutral/avoid
---
### Market Structure Detection
**BOS (Break of Structure):**
Occurs when price breaks the last swing high (in uptrend) or swing low (in downtrend), confirming trend continuation.
**MSS (Market Structure Shift):**
Detected when BOS occurs in the opposite direction of current trend, indicating potential reversal.
**CHoCH (Change of Character):**
Early warning signal when price touches but doesn't strongly break the previous swing, suggesting momentum loss.
---
### Previous Day Levels
**Calculation:**
Uses `request.security()` with daily timeframe and `[1]` offset with lookahead on:
- PDH: Previous Day High
- PDL: Previous Day Low
- PDM: (PDH + PDL) / 2
**Daily Bias Logic:**
- Bullish: Close > PDM or breakout above PDH
- Bearish: Close < PDM or breakdown below PDL
- Neutral: Close at PDM
---
## Why This Combination?
This indicator integrates multiple institutional concepts to create a **confluence-based filtering system** that answers three critical trading questions:
1. **WHERE to trade?** (Order Blocks, FVG, Premium/Discount zones, Fibonacci OTE)
2. **WHEN to trade?** (EMA Flips, Market Structure breaks, Ichimoku confirmation)
3. **WHICH direction?** (HTF Bias, Daily Bias, Cloud momentum, Structure trend)
### Synergy Between Components:
- **OB + FVG Confluence**: When an Order Block overlaps with a Fair Value Gap, it creates a high-probability institutional zone
- **Premium/Discount Context**: Filters OB signals to match institutional bias (buy Discount, sell Premium)
- **EMA Flips + Structure**: Fast momentum signals (flips) confirmed by slower structure breaks reduce false entries
- **Ichimoku Cloud**: Acts as additional trend filter, preventing counter-cloud trades
- **VWAP + Fibonacci**: Provides dynamic and static mean reversion levels for risk management
**Individual indicators might generate conflicting signals**, but this mashup requires multiple confirmations before highlighting setups, significantly reducing noise and improving trade quality.
---
## How to Use
### Setup Configuration
1. **Enable desired components** in settings (Essentials group)
2. **Adjust swing lengths** based on timeframe:
- M1-M5: Swing 5-7, Internal 3
- M15-H1: Swing 10, Internal 5 (default)
- H4-D1: Swing 15-20, Internal 7-10
3. **Configure filters**:
- Lower timeframes: Use ATR filter 0.3-0.5x
- Higher timeframes: Use CMR filter or 0.7-1.0x ATR
### Trading Workflow
**Step 1: Identify Trend**
- Check EMA Cloud colors (green = bullish, red = bearish)
- Confirm with Ichimoku Cloud position
- Verify Market Structure (BOS direction)
**Step 2: Find Confluence Zones**
- Locate active Order Blocks in trend direction
- Check for FVG overlap with OB
- Ensure zone is in correct Premium/Discount area
**Step 3: Wait for Entry Trigger**
- Monitor EMA 5/12 flips within confluence zone
- Check Fibonacci OTE zone if displayed
- Confirm VWAP position supports direction
**Step 4: Execute & Manage**
- Enter on flip signal within OB/FVG confluence
- Stop loss: Outside Order Block zone
- Target: Opposite Premium/Discount zone or next OB
---
## Dashboard Information
The on-chart table displays real-time market conditions:
- **Trend**: Current structure (Bullish/Bearish/Neutral)
- **HTF Bias**: Higher timeframe direction
- **OB**: Active Order Block status (Bull ↑ / Bear ↓ / None)
- **FVG**: Active Fair Value Gap (Bull ↑ / Bear ↓ / None)
- **OB+FVG**: Confluence confirmation (✓ when both align)
- **P/D Zone**: Current price position in Premium/Discount
- **Fib 61.8-78.6**: OTE zone status (In Zone / Outside)
- **Daily Bias**: ICT daily bias (Bullish/Bearish/Neutral)
- **Market Status**: Overall condition summary
- **RSI(14)**: Momentum (Oversold <30 / Neutral / Overbought >70)
- **Ichimoku**: Cloud position (Above/In/Below)
---
## Alert Conditions
Complete alert system for key events:
- BOS Bullish / Bearish detected
- New Order Block formed (Bullish/Bearish)
- New Internal OB formed
- EMA Flip signals (Up/Down)
- Price entering OTE zone (when HTF aligned)
---
## Best Practices
✅ **Use on multiple timeframes**: Align HTF bias with entry TF signals
✅ **Wait for confluence**: At least 2-3 confirmations before entry
✅ **Respect Premium/Discount**: Don't buy Premium or sell Discount
✅ **Adjust swing lengths**: Match to your trading timeframe
✅ **Backtest first**: Understand signal behavior before live trading
❌ **Don't overtrade**: Not every OB or FVG is a valid setup
❌ **Don't ignore filters**: Disabled filters increase false signals
❌ **Don't trade against cloud**: Ichimoku filter prevents low-probability trades
---
## Technical Specifications
- Pine Script™ Version: 6
- Overlay: Yes
- Max Boxes: 500
- Max Lines: 500
- Max Labels: 300
- Repainting: Signals confirmed on bar close (barstate.isconfirmed)
---
## Recommended Timeframes
- **Scalping**: M1, M5 (reduce swing lengths to 5-7)
- **Day Trading**: M15, M30, H1 (default settings)
- **Swing Trading**: H4, D1 (increase swing lengths to 15-20)
---
## Performance Notes
For optimal chart performance:
- Disable unused features (Structure, EQH/EQL if not needed)
- Reduce lookback periods on lower timeframes
- Limit to 1-2 active alerts per instrument
---
This indicator does not predict the future and should be used as part of a complete trading plan with proper risk management.
© 2025-2026
## Overview
SMC Precision Scalper is a comprehensive technical analysis indicator combining Smart Money Concepts (SMC) methodology with advanced scalping tools. This indicator integrates institutional trading concepts to provide traders with high-probability confluence zones and market structure analysis.
---
## How It Works - Technical Methodology
### Order Block Detection System
**Detection Algorithm:**
The script identifies Order Blocks using a three-criteria validation process:
1. **Pattern Recognition**: Scans for consolidation candles (opposite color to trend) that precede strong impulse moves
2. **Impulse Validation**: The following candle must break the high/low of the consolidation candle
- Strict Mode: Impulse candle must fully engulf the Order Block
- Standard Mode: Impulse candle must only break the OB high/low
3. **Volatility Filtering**: Applies ATR (Average True Range) or CMR (Cumulative Mean Range) filters with adjustable multiplier (default 0.5x) to eliminate noise
**Mitigation Tracking:**
Order Blocks are monitored until price retraces to their 50% level (midpoint). Mitigation can be calculated by either:
- Close price crossing the midpoint
- Wick penetration of the midpoint
Internal Order Blocks use shorter swing length (default 5 periods) for intraday precision, while standard OBs use longer swings (default 10 periods) for structural zones.
---
### Fair Value Gap (FVG) Calculation
**Gap Detection:**
FVGs are identified when:
Bullish FVG: (candle.low - candle.high) > ATR(14) × threshold
Bearish FVG: (candle.low - candle.high) > ATR(14) × threshold
Default threshold: 0.3x ATR multiplier
**Visual Rendering:**
Each FVG is rendered as 13 horizontal layers to show the liquidity void depth. The script tracks consecutive FVGs to adjust layer positioning dynamically.
**Mitigation Logic:**
FVGs remain active until price fully crosses the gap zone (high > gap bottom AND low < gap top). Optionally displays "filled" FVGs with reduced opacity for historical reference.
---
### EMA Confluence & Flips System
**Core Components:**
- EMA Fast: 5-period exponential moving average
- EMA Slow: 12-period exponential moving average
- EMA Confluence: 200-period exponential moving average (customizable)
**Flip Detection:**
Generates signals when EMA 5 crosses EMA 12:
- Flip Up (↑): EMA 5 crosses above EMA 12
- Flip Down (↓): EMA 5 crosses under EMA 12
**Trend Filter:**
Optional confluence filter requires:
- Uptrend confirmation: Close > EMA Confluence for N bars (adjustable)
- Downtrend confirmation: Close < EMA Confluence for N bars
This prevents counter-trend signals and improves accuracy.
---
### EMA Cloud Layers
**Calculation:**
Creates three multi-timeframe cloud zones using paired EMAs:
- Cloud 1: EMA 20 / EMA 42
- Cloud 2: EMA 8 / EMA 23
- Cloud 3: EMA 5 / EMA 50
**Color Logic:**
- Green cloud: Faster EMA > Slower EMA (bullish momentum)
- Red cloud: Faster EMA < Slower EMA (bearish momentum)
Each cloud has progressive transparency (10%, 16%, 22%) to show momentum strength layers.
---
### VWAP Implementation
**Session VWAP:**
Calculates volume-weighted average price that resets at each session boundary using TradingView's native `ta.vwap()` function.
**Daily VWAP:**
Custom implementation that resets every calendar day:
CumulativePV = Σ(Price × Volume)
CumulativeV = Σ(Volume)
Daily VWAP = CumulativePV / CumulativeV
Source price options: HLC3, Close, OHLC4, HL2
---
### Premium/Discount Zones
**Range Calculation:**
Based on selected mode (Trailing Swings, Daily/Weekly/Monthly Range):
- High 100% = Swing high or HTF high
- Low 0% = Swing low or HTF low
- Range = High - Low
**Zone Division:**
*3 Zones Simple Mode:*
- Premium: 66.67% - 100%
- Equilibrium: 33.33% - 66.67%
- Discount: 0% - 33.33%
*5 Zones Fibonacci Mode:*
- Strong Premium: 78.6% - 100%
- Premium: 61.8% - 78.6% (OTE Zone)
- Equilibrium: 38.2% - 61.8%
- Discount: 23.6% - 38.2%
- Strong Discount: 0% - 23.6%
**Purpose:**
Provides institutional context: institutions typically buy in Discount zones and sell in Premium zones.
---
### Fibonacci Retracement
**Auto-Calculation:**
- Scans the last N periods (default 80, range 20-200) to identify swing high and swing low
- Projects key Fibonacci levels: 0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%
- Optional inversion for downtrends
- Future projection extends levels forward by adjustable bars (default 50)
**OTE Zone Highlighting:**
Creates a visual box for the 61.8%-78.6% zone, which represents the Optimal Trade Entry area commonly used in ICT methodology.
---
### Ichimoku Cloud (Multi-Timeframe)
**Components Calculation:**
Tenkan-sen = (9-period high + 9-period low) / 2
Kijun-sen = (26-period high + 26-period low) / 2
Senkou Span A = (Tenkan + Kijun) / 2
Senkou Span B = (52-period high + 52-period low) / 2
Chikou Span = Close shifted back 26 periods
**MTF Implementation:**
Uses `request.security()` to fetch higher timeframe data when custom timeframe is specified. Falls back to chart timeframe if empty.
**Cloud Filtering:**
- Price above cloud = Bullish bias filter
- Price below cloud = Bearish bias filter
- Price in cloud = Neutral/avoid
---
### Market Structure Detection
**BOS (Break of Structure):**
Occurs when price breaks the last swing high (in uptrend) or swing low (in downtrend), confirming trend continuation.
**MSS (Market Structure Shift):**
Detected when BOS occurs in the opposite direction of current trend, indicating potential reversal.
**CHoCH (Change of Character):**
Early warning signal when price touches but doesn't strongly break the previous swing, suggesting momentum loss.
---
### Previous Day Levels
**Calculation:**
Uses `request.security()` with daily timeframe and `[1]` offset with lookahead on:
- PDH: Previous Day High
- PDL: Previous Day Low
- PDM: (PDH + PDL) / 2
**Daily Bias Logic:**
- Bullish: Close > PDM or breakout above PDH
- Bearish: Close < PDM or breakdown below PDL
- Neutral: Close at PDM
---
## Why This Combination?
This indicator integrates multiple institutional concepts to create a **confluence-based filtering system** that answers three critical trading questions:
1. **WHERE to trade?** (Order Blocks, FVG, Premium/Discount zones, Fibonacci OTE)
2. **WHEN to trade?** (EMA Flips, Market Structure breaks, Ichimoku confirmation)
3. **WHICH direction?** (HTF Bias, Daily Bias, Cloud momentum, Structure trend)
### Synergy Between Components:
- **OB + FVG Confluence**: When an Order Block overlaps with a Fair Value Gap, it creates a high-probability institutional zone
- **Premium/Discount Context**: Filters OB signals to match institutional bias (buy Discount, sell Premium)
- **EMA Flips + Structure**: Fast momentum signals (flips) confirmed by slower structure breaks reduce false entries
- **Ichimoku Cloud**: Acts as additional trend filter, preventing counter-cloud trades
- **VWAP + Fibonacci**: Provides dynamic and static mean reversion levels for risk management
**Individual indicators might generate conflicting signals**, but this mashup requires multiple confirmations before highlighting setups, significantly reducing noise and improving trade quality.
---
## How to Use
### Setup Configuration
1. **Enable desired components** in settings (Essentials group)
2. **Adjust swing lengths** based on timeframe:
- M1-M5: Swing 5-7, Internal 3
- M15-H1: Swing 10, Internal 5 (default)
- H4-D1: Swing 15-20, Internal 7-10
3. **Configure filters**:
- Lower timeframes: Use ATR filter 0.3-0.5x
- Higher timeframes: Use CMR filter or 0.7-1.0x ATR
### Trading Workflow
**Step 1: Identify Trend**
- Check EMA Cloud colors (green = bullish, red = bearish)
- Confirm with Ichimoku Cloud position
- Verify Market Structure (BOS direction)
**Step 2: Find Confluence Zones**
- Locate active Order Blocks in trend direction
- Check for FVG overlap with OB
- Ensure zone is in correct Premium/Discount area
**Step 3: Wait for Entry Trigger**
- Monitor EMA 5/12 flips within confluence zone
- Check Fibonacci OTE zone if displayed
- Confirm VWAP position supports direction
**Step 4: Execute & Manage**
- Enter on flip signal within OB/FVG confluence
- Stop loss: Outside Order Block zone
- Target: Opposite Premium/Discount zone or next OB
---
## Dashboard Information
The on-chart table displays real-time market conditions:
- **Trend**: Current structure (Bullish/Bearish/Neutral)
- **HTF Bias**: Higher timeframe direction
- **OB**: Active Order Block status (Bull ↑ / Bear ↓ / None)
- **FVG**: Active Fair Value Gap (Bull ↑ / Bear ↓ / None)
- **OB+FVG**: Confluence confirmation (✓ when both align)
- **P/D Zone**: Current price position in Premium/Discount
- **Fib 61.8-78.6**: OTE zone status (In Zone / Outside)
- **Daily Bias**: ICT daily bias (Bullish/Bearish/Neutral)
- **Market Status**: Overall condition summary
- **RSI(14)**: Momentum (Oversold <30 / Neutral / Overbought >70)
- **Ichimoku**: Cloud position (Above/In/Below)
---
## Alert Conditions
Complete alert system for key events:
- BOS Bullish / Bearish detected
- New Order Block formed (Bullish/Bearish)
- New Internal OB formed
- EMA Flip signals (Up/Down)
- Price entering OTE zone (when HTF aligned)
---
## Best Practices
✅ **Use on multiple timeframes**: Align HTF bias with entry TF signals
✅ **Wait for confluence**: At least 2-3 confirmations before entry
✅ **Respect Premium/Discount**: Don't buy Premium or sell Discount
✅ **Adjust swing lengths**: Match to your trading timeframe
✅ **Backtest first**: Understand signal behavior before live trading
❌ **Don't overtrade**: Not every OB or FVG is a valid setup
❌ **Don't ignore filters**: Disabled filters increase false signals
❌ **Don't trade against cloud**: Ichimoku filter prevents low-probability trades
---
## Technical Specifications
- Pine Script™ Version: 6
- Overlay: Yes
- Max Boxes: 500
- Max Lines: 500
- Max Labels: 300
- Repainting: Signals confirmed on bar close (barstate.isconfirmed)
---
## Recommended Timeframes
- **Scalping**: M1, M5 (reduce swing lengths to 5-7)
- **Day Trading**: M15, M30, H1 (default settings)
- **Swing Trading**: H4, D1 (increase swing lengths to 15-20)
---
## Performance Notes
For optimal chart performance:
- Disable unused features (Structure, EQH/EQL if not needed)
- Reduce lookback periods on lower timeframes
- Limit to 1-2 active alerts per instrument
---
This indicator does not predict the future and should be used as part of a complete trading plan with proper risk management.
© 2025-2026
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarle liberamente e senza alcuna limitazione – ulteriori informazioni qui.
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 protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarle liberamente e senza alcuna limitazione – ulteriori informazioni qui.
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.