OPEN-SOURCE SCRIPT

SB/ISB FVG/IFVG

1 968
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.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน