OPEN-SOURCE SCRIPT
מעודכן SMC Market Structure & MTF Levels by Capitan-Trading

Overview
The SMC Market Structure & MTF Levels is a comprehensive yet lightweight tool designed to help day traders and swing traders visualize market structure shifts, key multi-timeframe (MTF) levels, and custom trading sessions without cluttering the chart.
Underlying Logic & Features
This script is built around three core analytical modules:
1. Algorithmic Market Structure (CHoCH / BOS):
The indicator tracks market structure using a standard Pivot High / Pivot Low calculation (ta.pivothigh / ta.pivotlow). Users can define the sensitivity by adjusting the left and right lookback bars. When the price strictly closes (if 'Confirmed Only' is enabled) above the last detected pivot high, the script dynamically identifies a bullish shift (CHoCH/BOS). Conversely, a close below the last pivot low flags a bearish structural break.
2. Multi-Timeframe Levels with Staggered Visuals:
The script fetches the Previous Daily (PDH/PDL), Weekly (PWH/PWL), and Monthly (PMH/PML) highs and lows using secure request.security calls to prevent any lookahead bias. A common issue with MTF levels is overlapping labels when a Daily high coincides with a Weekly high. To solve this, the script applies a dynamic horizontal offset engine: Daily, Weekly, and Monthly lines project at different lengths into the future (e.g., +20, +28, +36 bars), ensuring all labels are perfectly readable side-by-side.
3. Session Boxes & Real-Time Dashboard:
Users can highlight up to three custom time sessions (e.g., Asian range, London Open, NY Open) with adjustable background boxes. Additionally, a minimalist, non-intrusive dashboard displays the current structural bias (Bull/Bear) and calculates the real-time percentage distance between the current price and the major MTF levels, giving traders an immediate gauge of liquidity proximity.
Usage:
Apply this tool to any timeframe to maintain a clear top-down perspective of structural shifts and major liquidity magnets.
The SMC Market Structure & MTF Levels is a comprehensive yet lightweight tool designed to help day traders and swing traders visualize market structure shifts, key multi-timeframe (MTF) levels, and custom trading sessions without cluttering the chart.
Underlying Logic & Features
This script is built around three core analytical modules:
1. Algorithmic Market Structure (CHoCH / BOS):
The indicator tracks market structure using a standard Pivot High / Pivot Low calculation (ta.pivothigh / ta.pivotlow). Users can define the sensitivity by adjusting the left and right lookback bars. When the price strictly closes (if 'Confirmed Only' is enabled) above the last detected pivot high, the script dynamically identifies a bullish shift (CHoCH/BOS). Conversely, a close below the last pivot low flags a bearish structural break.
2. Multi-Timeframe Levels with Staggered Visuals:
The script fetches the Previous Daily (PDH/PDL), Weekly (PWH/PWL), and Monthly (PMH/PML) highs and lows using secure request.security calls to prevent any lookahead bias. A common issue with MTF levels is overlapping labels when a Daily high coincides with a Weekly high. To solve this, the script applies a dynamic horizontal offset engine: Daily, Weekly, and Monthly lines project at different lengths into the future (e.g., +20, +28, +36 bars), ensuring all labels are perfectly readable side-by-side.
3. Session Boxes & Real-Time Dashboard:
Users can highlight up to three custom time sessions (e.g., Asian range, London Open, NY Open) with adjustable background boxes. Additionally, a minimalist, non-intrusive dashboard displays the current structural bias (Bull/Bear) and calculates the real-time percentage distance between the current price and the major MTF levels, giving traders an immediate gauge of liquidity proximity.
Usage:
Apply this tool to any timeframe to maintain a clear top-down perspective of structural shifts and major liquidity magnets.
הערות שחרור
OverviewThe SMC Market Structure & MTF Levels is a comprehensive yet lightweight tool designed to help day traders and swing traders visualize market structure shifts, key multi-timeframe (MTF) levels, and custom trading sessions without cluttering the chart.
Underlying Logic & Features
This script is built around three core analytical modules:
1. Algorithmic Market Structure (CHoCH / BOS):
The indicator tracks market structure using a standard Pivot High / Pivot Low calculation (ta.pivothigh / ta.pivotlow). Users can define the sensitivity by adjusting the left and right lookback bars. When the price strictly closes (if 'Confirmed Only' is enabled) above the last detected pivot high, the script dynamically identifies a bullish shift (CHoCH/BOS). Conversely, a close below the last pivot low flags a bearish structural break.
2. Multi-Timeframe Levels with Staggered Visuals:
The script fetches the Previous Daily (PDH/PDL), Weekly (PWH/PWL), and Monthly (PMH/PML) highs and lows using secure request.security calls to prevent any lookahead bias. A common issue with MTF levels is overlapping labels when a Daily high coincides with a Weekly high. To solve this, the script applies a dynamic horizontal offset engine: Daily, Weekly, and Monthly lines project at different lengths into the future (e.g., +20, +28, +36 bars), ensuring all labels are perfectly readable side-by-side.
3. Session Boxes & Real-Time Dashboard:
Users can highlight up to three custom time sessions (e.g., Asian range, London Open, NY Open) with adjustable background boxes. Additionally, a minimalist, non-intrusive dashboard displays the current structural bias (Bull/Bear) and calculates the real-time percentage distance between the current price and the major MTF levels, giving traders an immediate gauge of liquidity proximity.
Usage:
Apply this tool to any timeframe to maintain a clear top-down perspective of structural shifts and major liquidity magnets.
הערות שחרור
Updated:- Improved MTF label alignment
- Minor dashboard refinement
- Performance optimizations
הערות שחרור
Update Notes:Upgraded the SMC engine (CHoCH/BOS) with strict institutional logic to completely prevent repainting and false signals.
Restored and deeply optimized the Liquidity Engine (Pivot tracking, Sweeps, and Mitigation) for better performance.
Fixed minor Pine Script v6 compatibility issues to ensure maximum stability across all timeframes.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
Percorso completo: Wyckoff – Smart Money – ICT
capitan-trading.com/
capitan-trading.com/
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
Percorso completo: Wyckoff – Smart Money – ICT
capitan-trading.com/
capitan-trading.com/
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.