OPEN-SOURCE SCRIPT
KEY LEVEL SMC - Order Block

The "KEY LEVEL SMC - Order Block" is a specialized institutional technical analysis tool optimized for TradingView v6. It automatically detects, highlights, and projects Order Blocks (OB) using strict algorithmic price action and structural efficiency logic.
This indicator is specifically engineered for traders utilizing Smart Money Concepts (SMC) and Order Flow mechanics to maintain an objective view of institutional supply and demand zones.
### 📐 How It Works (Algorithmic Logic):
Unlike standard engulfing indicators, this script applies a strict filter requiring the immediate displacement to leave a structural imbalance (Fair Value Gap/Inefficiency) behind. The signal evaluates a 3-candle sequence:
1. **Bullish Order Block Configuration:**
- The setup identifies a specific institutional down-candle followed by aggressive upward displacement.
- A valid signal is triggered only if the opening price of the current setup candle is within or below the previous candle's body, closes above the previous candle's open, and the subsequent candle's low fails to mitigate the high of the initial candle (confirming an immediate structural imbalance).
- **Zone Boundaries:** The automated box marks the lowest point between the two initial candles as the bottom zone, and the open price of the setup candle as the top zone.
2. **Bearish Order Block Configuration:**
- The setup tracks an institutional up-candle followed by sharp downward displacement.
- Trigger criteria mandate that the setup candle opens within or above the previous body, closes below the previous open, and the subsequent candle's high leaves an unmitigated gap below the previous candle's low.
- **Zone Boundaries:** The automated box spans from the highest point of the displacement candles to the open price of the setup candle.
### 💻 Key Features & Customization:
* **Dynamic Box Array Management:** The script utilizes dynamic arrays (`box[]`) to plot and track multiple historical zones simultaneously. To ensure peak chart performance without causing lag, it features an automated memory cleanup loop governed by the "Maximum Box Displayed" parameter.
* **Real-time Extensions:** Zones remain active and extend dynamically to the right with each new bar until the price action fully mitigates or invalidates the defined structural level.
* **Dark-Mode Optimized UI:** Built-in customized color groups allow traders to seamlessly adjust candle overlays and box transparencies to fit professional dark layout themes perfectly.
### 🛑 Disclaimer & Use Case:
This tool is intended for professional intraday and swing trading strategies across major pairs, indices, and metals. It works best when combined with higher-timeframe order flow alignment and key Fibonacci expansion target objectives.
This indicator is specifically engineered for traders utilizing Smart Money Concepts (SMC) and Order Flow mechanics to maintain an objective view of institutional supply and demand zones.
### 📐 How It Works (Algorithmic Logic):
Unlike standard engulfing indicators, this script applies a strict filter requiring the immediate displacement to leave a structural imbalance (Fair Value Gap/Inefficiency) behind. The signal evaluates a 3-candle sequence:
1. **Bullish Order Block Configuration:**
- The setup identifies a specific institutional down-candle followed by aggressive upward displacement.
- A valid signal is triggered only if the opening price of the current setup candle is within or below the previous candle's body, closes above the previous candle's open, and the subsequent candle's low fails to mitigate the high of the initial candle (confirming an immediate structural imbalance).
- **Zone Boundaries:** The automated box marks the lowest point between the two initial candles as the bottom zone, and the open price of the setup candle as the top zone.
2. **Bearish Order Block Configuration:**
- The setup tracks an institutional up-candle followed by sharp downward displacement.
- Trigger criteria mandate that the setup candle opens within or above the previous body, closes below the previous open, and the subsequent candle's high leaves an unmitigated gap below the previous candle's low.
- **Zone Boundaries:** The automated box spans from the highest point of the displacement candles to the open price of the setup candle.
### 💻 Key Features & Customization:
* **Dynamic Box Array Management:** The script utilizes dynamic arrays (`box[]`) to plot and track multiple historical zones simultaneously. To ensure peak chart performance without causing lag, it features an automated memory cleanup loop governed by the "Maximum Box Displayed" parameter.
* **Real-time Extensions:** Zones remain active and extend dynamically to the right with each new bar until the price action fully mitigates or invalidates the defined structural level.
* **Dark-Mode Optimized UI:** Built-in customized color groups allow traders to seamlessly adjust candle overlays and box transparencies to fit professional dark layout themes perfectly.
### 🛑 Disclaimer & Use Case:
This tool is intended for professional intraday and swing trading strategies across major pairs, indices, and metals. It works best when combined with higher-timeframe order flow alignment and key Fibonacci expansion target objectives.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.