OPEN-SOURCE SCRIPT
Smart Structure Pro - Market Structure & Smart Money Concepts

═══════════════════════════════════════════════════════════════════════════════
SMART STRUCTURE PRO
═══════════════════════════════════════════════════════════════════════════════
A comprehensive market structure analysis tool that identifies institutional trading
patterns and smart money concepts for improved trade timing and decision-making.
═══════════════════════════════════════════════════════════════════════════════
📊 WHAT IT DOES
═══════════════════════════════════════════════════════════════════════════════
This indicator automatically detects and visualizes key market structure elements:
🔹 BOS (Break of Structure)
- Identifies trend continuation patterns
- Marks when price breaks above previous highs (bullish) or below previous lows (bearish)
- Confirms trend strength and momentum
🔹 CHoCH (Change of Character)
- Detects potential trend reversals
- Alerts when market structure shifts from bullish to bearish or vice versa
- Helps identify early reversal opportunities
🔹 Order Blocks
- Highlights institutional entry zones
- Identifies the last opposite candle before a structure break
- Shows areas where smart money likely entered positions
🔹 Fair Value Gaps (FVG)
- Detects price imbalances and inefficiencies
- Shows areas where price moved rapidly leaving gaps
- Often act as support/resistance when retested
🔹 Liquidity Zones
- Marks swing high and low levels
- Identifies areas where stop losses likely cluster
- Shows potential stop hunt and liquidity grab zones
═══════════════════════════════════════════════════════════════════════════════
🎯 HOW TO USE
═══════════════════════════════════════════════════════════════════════════════
BULLISH SETUP:
1. Wait for Bullish CHoCH (trend reversal signal) or BOS ↑ (continuation)
2. Look for price to pull back into an Order Block or Fair Value Gap
3. Enter long when price bounces from these zones
4. Place stop loss below the Order Block
5. Target the next liquidity zone or resistance level
BEARISH SETUP:
1. Wait for Bearish CHoCH (trend reversal signal) or BOS ↓ (continuation)
2. Look for price to retrace into an Order Block or Fair Value Gap
3. Enter short when price rejects from these zones
4. Place stop loss above the Order Block
5. Target the next liquidity zone or support level
DASHBOARD INTERPRETATION:
• Trend: Current market direction (Bullish/Bearish)
• Volume: Confirmation strength (High volume = stronger signals)
• Signal: Latest structure break detected
• Key High/Low: Critical levels for the current trend
• Position: Price location (Premium = expensive, Discount = cheap)
═══════════════════════════════════════════════════════════════════════════════
⚙️ SETTINGS GUIDE
═══════════════════════════════════════════════════════════════════════════════
STRUCTURE DETECTION:
• Pivot Length (Default: 10)
- Lower values = More signals but potentially weaker
- Higher values = Fewer signals but stronger/more reliable
- Recommended: 8-12 for intraday, 10-15 for higher timeframes
• Structure Line Extension
- Visual preference for how far lines extend
- Does not affect signal detection
SMART MONEY CONCEPTS:
• Order Block Extension: How long OB boxes remain visible
• FVG Extension: How long gap boxes remain visible
• Min FVG Size: Filter out small gaps (0 = show all)
- Set to 10-20% to reduce noise
- Set to 0 to see all gaps
VOLUME FILTER:
• Volume Confirmation (Recommended: ON)
- Filters weak signals without volume support
- Reduces false breakouts
• Volume Multiplier (Default: 1.5)
- Higher = Stricter filtering (fewer but stronger signals)
- Lower = More signals (but may include weak ones)
DISPLAY:
• Dashboard: Toggle information panel
• Trend Background: Subtle color tint showing current trend
• Dashboard Position: Choose corner placement
═══════════════════════════════════════════════════════════════════════════════
🔔 ALERTS
═══════════════════════════════════════════════════════════════════════════════
Available alert conditions:
✓ Bullish BOS - Uptrend continuation confirmed
✓ Bearish BOS - Downtrend continuation confirmed
✓ Bullish CHoCH - Reversal to uptrend detected
✓ Bearish CHoCH - Reversal to downtrend detected
✓ Structure Break - Any significant market structure change
To set up alerts:
1. Click the "⏰" alert icon
2. Select "Smart Structure Pro"
3. Choose your desired condition
4. Configure notification method
5. Click "Create"
═══════════════════════════════════════════════════════════════════════════════
⚠️ IMPORTANT DISCLOSURES
═══════════════════════════════════════════════════════════════════════════════
REPAINTING BEHAVIOR:
• Pivot points WILL repaint until confirmed (this is by design and unavoidable)
• Structure breaks (BOS/CHoCH) use CLOSED candles and do NOT repaint after confirmation
• Order Blocks and FVGs are drawn on confirmed signals and do NOT repaint
• All signals wait for candle close before triggering
BEST PRACTICES:
• Use on higher timeframes (15min+) for more reliable signals
• Combine with other analysis (support/resistance, volume profile, etc.)
• Wait for candle close confirmation before acting on signals
• Use proper risk management - this is not a standalone trading system
• Backtest on your preferred instrument and timeframe
PERFORMANCE:
• Limited to 100 boxes, 100 lines, 100 labels for optimal performance
• Older objects automatically removed as new ones appear
• Works on all markets (Forex, Crypto, Stocks, Indices, Commodities)
═══════════════════════════════════════════════════════════════════════════════
📚 CONCEPTS EXPLAINED
═══════════════════════════════════════════════════════════════════════════════
MARKET STRUCTURE:
Market structure refers to the pattern of price movements creating swing highs
and lows. Understanding structure helps identify trend direction and potential
reversal points.
SMART MONEY CONCEPTS:
These are trading techniques based on tracking institutional order flow and
understanding where large players (banks, funds, institutions) enter and exit
positions.
ORDER BLOCKS:
The last opposing candle before a strong directional move. Institutions often
leave unfilled orders in these zones, which can act as support/resistance when
price returns.
FAIR VALUE GAPS:
Areas where price moved so quickly that it left an imbalance. These gaps often
get "filled" as price returns to find equilibrium, creating trading opportunities.
═══════════════════════════════════════════════════════════════════════════════
🎓 EDUCATIONAL VALUE
═══════════════════════════════════════════════════════════════════════════════
This indicator helps traders:
✓ Understand market structure mechanics
✓ Identify institutional trading patterns
✓ Improve trade timing and entry precision
✓ Recognize trend continuation vs reversal
✓ Learn smart money concepts through visualization
═══════════════════════════════════════════════════════════════════════════════
📋 TECHNICAL DETAILS
═══════════════════════════════════════════════════════════════════════════════
• Version: 1.0.0
• Pine Script Version: 5
• Indicator Type: Overlay
• No Repainting: Structure breaks use confirmed candles
• Performance Optimized: Limited drawing objects
• Works On: All markets and timeframes
• Alerts: Yes, fully customizable
═══════════════════════════════════════════════════════════════════════════════
👤 AUTHOR
═══════════════════════════════════════════════════════════════════════════════
Created by: Zakaria Safri
Original Work: All code and concepts are original implementations
Based On: ICT (Inner Circle Trader) educational concepts
License: © 2024 Zakaria Safri - Personal Use Only
═══════════════════════════════════════════════════════════════════════════════
⚖️ DISCLAIMER
═══════════════════════════════════════════════════════════════════════════════
This indicator is for educational and informational purposes only. It does not
constitute financial advice. Trading involves substantial risk of loss. Past
performance does not guarantee future results. Always conduct your own research
and consult with a licensed financial advisor before making trading decisions.
The author is not responsible for any losses incurred from using this indicator.
═══════════════════════════════════════════════════════════════════════════════
If you find this indicator helpful, please:
👍 Like and favorite
⭐ Leave a review
📢 Share with other traders
💬 Comment with feedback or suggestions
Happy Trading! 📈
SMART STRUCTURE PRO
═══════════════════════════════════════════════════════════════════════════════
A comprehensive market structure analysis tool that identifies institutional trading
patterns and smart money concepts for improved trade timing and decision-making.
═══════════════════════════════════════════════════════════════════════════════
📊 WHAT IT DOES
═══════════════════════════════════════════════════════════════════════════════
This indicator automatically detects and visualizes key market structure elements:
🔹 BOS (Break of Structure)
- Identifies trend continuation patterns
- Marks when price breaks above previous highs (bullish) or below previous lows (bearish)
- Confirms trend strength and momentum
🔹 CHoCH (Change of Character)
- Detects potential trend reversals
- Alerts when market structure shifts from bullish to bearish or vice versa
- Helps identify early reversal opportunities
🔹 Order Blocks
- Highlights institutional entry zones
- Identifies the last opposite candle before a structure break
- Shows areas where smart money likely entered positions
🔹 Fair Value Gaps (FVG)
- Detects price imbalances and inefficiencies
- Shows areas where price moved rapidly leaving gaps
- Often act as support/resistance when retested
🔹 Liquidity Zones
- Marks swing high and low levels
- Identifies areas where stop losses likely cluster
- Shows potential stop hunt and liquidity grab zones
═══════════════════════════════════════════════════════════════════════════════
🎯 HOW TO USE
═══════════════════════════════════════════════════════════════════════════════
BULLISH SETUP:
1. Wait for Bullish CHoCH (trend reversal signal) or BOS ↑ (continuation)
2. Look for price to pull back into an Order Block or Fair Value Gap
3. Enter long when price bounces from these zones
4. Place stop loss below the Order Block
5. Target the next liquidity zone or resistance level
BEARISH SETUP:
1. Wait for Bearish CHoCH (trend reversal signal) or BOS ↓ (continuation)
2. Look for price to retrace into an Order Block or Fair Value Gap
3. Enter short when price rejects from these zones
4. Place stop loss above the Order Block
5. Target the next liquidity zone or support level
DASHBOARD INTERPRETATION:
• Trend: Current market direction (Bullish/Bearish)
• Volume: Confirmation strength (High volume = stronger signals)
• Signal: Latest structure break detected
• Key High/Low: Critical levels for the current trend
• Position: Price location (Premium = expensive, Discount = cheap)
═══════════════════════════════════════════════════════════════════════════════
⚙️ SETTINGS GUIDE
═══════════════════════════════════════════════════════════════════════════════
STRUCTURE DETECTION:
• Pivot Length (Default: 10)
- Lower values = More signals but potentially weaker
- Higher values = Fewer signals but stronger/more reliable
- Recommended: 8-12 for intraday, 10-15 for higher timeframes
• Structure Line Extension
- Visual preference for how far lines extend
- Does not affect signal detection
SMART MONEY CONCEPTS:
• Order Block Extension: How long OB boxes remain visible
• FVG Extension: How long gap boxes remain visible
• Min FVG Size: Filter out small gaps (0 = show all)
- Set to 10-20% to reduce noise
- Set to 0 to see all gaps
VOLUME FILTER:
• Volume Confirmation (Recommended: ON)
- Filters weak signals without volume support
- Reduces false breakouts
• Volume Multiplier (Default: 1.5)
- Higher = Stricter filtering (fewer but stronger signals)
- Lower = More signals (but may include weak ones)
DISPLAY:
• Dashboard: Toggle information panel
• Trend Background: Subtle color tint showing current trend
• Dashboard Position: Choose corner placement
═══════════════════════════════════════════════════════════════════════════════
🔔 ALERTS
═══════════════════════════════════════════════════════════════════════════════
Available alert conditions:
✓ Bullish BOS - Uptrend continuation confirmed
✓ Bearish BOS - Downtrend continuation confirmed
✓ Bullish CHoCH - Reversal to uptrend detected
✓ Bearish CHoCH - Reversal to downtrend detected
✓ Structure Break - Any significant market structure change
To set up alerts:
1. Click the "⏰" alert icon
2. Select "Smart Structure Pro"
3. Choose your desired condition
4. Configure notification method
5. Click "Create"
═══════════════════════════════════════════════════════════════════════════════
⚠️ IMPORTANT DISCLOSURES
═══════════════════════════════════════════════════════════════════════════════
REPAINTING BEHAVIOR:
• Pivot points WILL repaint until confirmed (this is by design and unavoidable)
• Structure breaks (BOS/CHoCH) use CLOSED candles and do NOT repaint after confirmation
• Order Blocks and FVGs are drawn on confirmed signals and do NOT repaint
• All signals wait for candle close before triggering
BEST PRACTICES:
• Use on higher timeframes (15min+) for more reliable signals
• Combine with other analysis (support/resistance, volume profile, etc.)
• Wait for candle close confirmation before acting on signals
• Use proper risk management - this is not a standalone trading system
• Backtest on your preferred instrument and timeframe
PERFORMANCE:
• Limited to 100 boxes, 100 lines, 100 labels for optimal performance
• Older objects automatically removed as new ones appear
• Works on all markets (Forex, Crypto, Stocks, Indices, Commodities)
═══════════════════════════════════════════════════════════════════════════════
📚 CONCEPTS EXPLAINED
═══════════════════════════════════════════════════════════════════════════════
MARKET STRUCTURE:
Market structure refers to the pattern of price movements creating swing highs
and lows. Understanding structure helps identify trend direction and potential
reversal points.
SMART MONEY CONCEPTS:
These are trading techniques based on tracking institutional order flow and
understanding where large players (banks, funds, institutions) enter and exit
positions.
ORDER BLOCKS:
The last opposing candle before a strong directional move. Institutions often
leave unfilled orders in these zones, which can act as support/resistance when
price returns.
FAIR VALUE GAPS:
Areas where price moved so quickly that it left an imbalance. These gaps often
get "filled" as price returns to find equilibrium, creating trading opportunities.
═══════════════════════════════════════════════════════════════════════════════
🎓 EDUCATIONAL VALUE
═══════════════════════════════════════════════════════════════════════════════
This indicator helps traders:
✓ Understand market structure mechanics
✓ Identify institutional trading patterns
✓ Improve trade timing and entry precision
✓ Recognize trend continuation vs reversal
✓ Learn smart money concepts through visualization
═══════════════════════════════════════════════════════════════════════════════
📋 TECHNICAL DETAILS
═══════════════════════════════════════════════════════════════════════════════
• Version: 1.0.0
• Pine Script Version: 5
• Indicator Type: Overlay
• No Repainting: Structure breaks use confirmed candles
• Performance Optimized: Limited drawing objects
• Works On: All markets and timeframes
• Alerts: Yes, fully customizable
═══════════════════════════════════════════════════════════════════════════════
👤 AUTHOR
═══════════════════════════════════════════════════════════════════════════════
Created by: Zakaria Safri
Original Work: All code and concepts are original implementations
Based On: ICT (Inner Circle Trader) educational concepts
License: © 2024 Zakaria Safri - Personal Use Only
═══════════════════════════════════════════════════════════════════════════════
⚖️ DISCLAIMER
═══════════════════════════════════════════════════════════════════════════════
This indicator is for educational and informational purposes only. It does not
constitute financial advice. Trading involves substantial risk of loss. Past
performance does not guarantee future results. Always conduct your own research
and consult with a licensed financial advisor before making trading decisions.
The author is not responsible for any losses incurred from using this indicator.
═══════════════════════════════════════════════════════════════════════════════
If you find this indicator helpful, please:
👍 Like and favorite
⭐ Leave a review
📢 Share with other traders
💬 Comment with feedback or suggestions
Happy Trading! 📈
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.