OPEN-SOURCE SCRIPT
SMC Structure Identifier

This indicator uses SMC (ICT) concept for market structure identification.
It maps market structure using confirmed swing highs and swing lows, then builds structural logic from those points. It is designed to separate raw swings from meaningful structural swings, label the structure, and optionally display Break of Structure (BOS) events.
The swing logic uses a configurable lookback and forward confirmation window. Once raw swings are detected, consecutive highs or lows are compared so that only the most structurally relevant point is kept. Overwritten swings can optionally be shown separately, making it easier to understand how structure is being filtered.
Features:
• Confirmed swing high and swing low detection
• Structural swing filtering with overwritten swing handling
• Optional HH, LH, HL, and LL labels
• Optional bullish and bearish BOS detection
• BOS based on protected highs/lows and candle close
• Customizable swing marker size and colors
• Customizable BOS colors, line width, and label placement
• Ability to show or hide ignored/overwritten swings
Logic:
A structural swing is confirmed when an opposite swing appears. If multiple swings of the same type occur before an opposite swing confirms structure, only the most extreme swing is kept:
• Higher highs replace prior unconfirmed highs
• Lower lows replace prior unconfirmed lows
Trend and BOS logic are based on protected highs and lows:
• In a bearish trend, a close above the protected high marks a bullish BOS
• In a bullish trend, a close below the protected low marks a bearish BOS
This tool is intended for traders who use SMC for market structure, swing analysis, and break-of-structure concepts in their discretionary analysis.
Note:
1. Market Structure inside SMC is subjective; this indicator is an attempt to implement it into the code. Regulate Lookforward and Lookback variables to find the most suitable structure for you.
2. This indicator does not provide buy or sell signals. It is a visual structure-mapping tool and should be used together with your own trading plan, risk management, and additional analysis.
It maps market structure using confirmed swing highs and swing lows, then builds structural logic from those points. It is designed to separate raw swings from meaningful structural swings, label the structure, and optionally display Break of Structure (BOS) events.
The swing logic uses a configurable lookback and forward confirmation window. Once raw swings are detected, consecutive highs or lows are compared so that only the most structurally relevant point is kept. Overwritten swings can optionally be shown separately, making it easier to understand how structure is being filtered.
Features:
• Confirmed swing high and swing low detection
• Structural swing filtering with overwritten swing handling
• Optional HH, LH, HL, and LL labels
• Optional bullish and bearish BOS detection
• BOS based on protected highs/lows and candle close
• Customizable swing marker size and colors
• Customizable BOS colors, line width, and label placement
• Ability to show or hide ignored/overwritten swings
Logic:
A structural swing is confirmed when an opposite swing appears. If multiple swings of the same type occur before an opposite swing confirms structure, only the most extreme swing is kept:
• Higher highs replace prior unconfirmed highs
• Lower lows replace prior unconfirmed lows
Trend and BOS logic are based on protected highs and lows:
• In a bearish trend, a close above the protected high marks a bullish BOS
• In a bullish trend, a close below the protected low marks a bearish BOS
This tool is intended for traders who use SMC for market structure, swing analysis, and break-of-structure concepts in their discretionary analysis.
Note:
1. Market Structure inside SMC is subjective; this indicator is an attempt to implement it into the code. Regulate Lookforward and Lookback variables to find the most suitable structure for you.
2. This indicator does not provide buy or sell signals. It is a visual structure-mapping tool and should be used together with your own trading plan, risk management, and additional analysis.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。