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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.