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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。