OPEN-SOURCE SCRIPT
SB/ISB FVG/IFVG

This script is a specialized indicator designed for **ICT (Inner Circle Trader)** and **Smart Money Concepts (SMC)**. Its primary focus is on automatically identifying, drawing, and managing **Fair Value Gaps (FVG)** and **Suspension Blocks (SB)**, as well as their **Inverted** counterparts.
Here is a detailed breakdown of what this indicator does and its main features:
**1. FVG & IFVG (Fair Value Gaps & Inversions)**
* **FVG (Fair Value Gap):** The script scans for traditional 3-bar imbalances. If it finds a Bullish FVG (default teal) or a Bearish FVG (default red), it draws a box projecting the zone forward.
* **IFVG (Inverted Fair Value Gap):** In ICT theory, when a Fair Value Gap fails to hold the price and gets decisively broken (price closes through it), it changes polarity. This script automatically detects when an FVG is violated, deletes the old FVG box, and creates a new **IFVG** box (default orange). A violated support FVG becomes a resistance IFVG, and vice versa.
**2. SB & ISB (Suspension Blocks & Inversions)**
* **SB (Suspension Block):** This is a specific price action pattern where a candle's body is completely "suspended" or isolated by gaps from the preceding and succeeding candles. The script calculates the tolerance and draws a box around this suspended body, projecting it as a zone of support or resistance.
* **Mean Threshold (Middle Line):** For every Suspension Block, the indicator automatically draws a line directly through the middle (50% level) of the block, which is a highly sensitive algorithmic level in SMC.
* **ISB (Inverted Suspension Block):** Just like the FVGs, if a Suspension Block is violated (price closes completely through it), the indicator flips it into an **ISB** (default orange). The old label changes from "+ suspension" to "+ISB", indicating the zone has flipped its polarity.
**3. Dynamic Chart Management (Mitigation)**
To prevent your chart from looking like a messy coloring book, the script has strict dynamic management rules:
* **Zone Deletion:** Once a zone (FVG, IFVG, SB, or ISB) is fully mitigated or invalidated by price action according to the script's rules, it stops drawing the box.
* **History Limits:** You can define exactly how many active FVGs, IFVGs, SBs, and ISBs you want to keep on the screen at a time (e.g., maximum 5 FVGs and 3 ISBs). Older zones are automatically deleted as new ones form.
**4. Customization & Visuals**
* **Labels:** Automatically tags the blocks on your chart (e.g., "+ suspension" or "-ISB") so you know exactly what zone you are looking at.
* **Tolerances:** You can adjust the "Tolerance %" for how strict the script should be when identifying the gaps for Suspension Blocks.
* **Aesthetics:** Full control over colors, box transparencies, and the style of the middle line (Solid, Dashed, Dotted).
**In summary:** This is a dynamic supply/demand and imbalance tracker. Instead of manually drawing FVGs and Order Blocks and adjusting them when they break, this indicator automates the entire lifecycle of these zones—drawing them when they form, inverting them when they fail, and deleting them when they are no longer relevant to the current price action.
Here is a detailed breakdown of what this indicator does and its main features:
**1. FVG & IFVG (Fair Value Gaps & Inversions)**
* **FVG (Fair Value Gap):** The script scans for traditional 3-bar imbalances. If it finds a Bullish FVG (default teal) or a Bearish FVG (default red), it draws a box projecting the zone forward.
* **IFVG (Inverted Fair Value Gap):** In ICT theory, when a Fair Value Gap fails to hold the price and gets decisively broken (price closes through it), it changes polarity. This script automatically detects when an FVG is violated, deletes the old FVG box, and creates a new **IFVG** box (default orange). A violated support FVG becomes a resistance IFVG, and vice versa.
**2. SB & ISB (Suspension Blocks & Inversions)**
* **SB (Suspension Block):** This is a specific price action pattern where a candle's body is completely "suspended" or isolated by gaps from the preceding and succeeding candles. The script calculates the tolerance and draws a box around this suspended body, projecting it as a zone of support or resistance.
* **Mean Threshold (Middle Line):** For every Suspension Block, the indicator automatically draws a line directly through the middle (50% level) of the block, which is a highly sensitive algorithmic level in SMC.
* **ISB (Inverted Suspension Block):** Just like the FVGs, if a Suspension Block is violated (price closes completely through it), the indicator flips it into an **ISB** (default orange). The old label changes from "+ suspension" to "+ISB", indicating the zone has flipped its polarity.
**3. Dynamic Chart Management (Mitigation)**
To prevent your chart from looking like a messy coloring book, the script has strict dynamic management rules:
* **Zone Deletion:** Once a zone (FVG, IFVG, SB, or ISB) is fully mitigated or invalidated by price action according to the script's rules, it stops drawing the box.
* **History Limits:** You can define exactly how many active FVGs, IFVGs, SBs, and ISBs you want to keep on the screen at a time (e.g., maximum 5 FVGs and 3 ISBs). Older zones are automatically deleted as new ones form.
**4. Customization & Visuals**
* **Labels:** Automatically tags the blocks on your chart (e.g., "+ suspension" or "-ISB") so you know exactly what zone you are looking at.
* **Tolerances:** You can adjust the "Tolerance %" for how strict the script should be when identifying the gaps for Suspension Blocks.
* **Aesthetics:** Full control over colors, box transparencies, and the style of the middle line (Solid, Dashed, Dotted).
**In summary:** This is a dynamic supply/demand and imbalance tracker. Instead of manually drawing FVGs and Order Blocks and adjusting them when they break, this indicator automates the entire lifecycle of these zones—drawing them when they form, inverting them when they fail, and deleting them when they are no longer relevant to the current price action.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.