OPEN-SOURCE SCRIPT
CISD Fractal HTF BY HDSXN

This script is a highly specialized indicator designed around the **ICT (Inner Circle Trader)** concept of **CISD (Change in State of Delivery)**. Its main purpose is to identify and track structural shifts in market delivery across both your current timeframe and Higher Timeframes (HTF).
Here is a detailed breakdown of what this indicator does and its main features:
**1. Core Concept: CISD (Change in State of Delivery)**
In ICT theory, a "State of Delivery" refers to consecutive candles moving in the same direction (e.g., a series of down candles meaning the algorithm is delivering sell-side price). A **CISD** occurs when the market shifts this state:
* **Bullish CISD:** Occurs when price closes *above the opening price* of the last bearish delivery sequence. It signals that the market has shifted from selling to buying. The script plots a Blue line at this key level.
* **Bearish CISD:** Occurs when price closes *below the opening price* of the last bullish delivery sequence. It signals a shift from buying to selling. The script plots a Red line at this level.
These lines act as highly sensitive institutional support and resistance levels.
**2. Fractal Higher Timeframe (HTF) System**
Instead of just looking at the chart you have open, the indicator runs the CISD logic on multiple timeframes simultaneously:
* **Fractal Mode (Automatic):** It dynamically calculates the appropriate higher timeframes based on the chart you are viewing. For example, if you are on a 1-minute chart, it might look for 15m CISDs; if you are on a 5-minute chart, it looks for 1H and Daily CISDs.
* **Fixed Modes:** You can override the automatic system and force the indicator to *only* look for CISDs on the **1 Hour**, **4 Hour**, or **1H + 4H** timeframes, regardless of what chart you are looking at.
* **Current Timeframe:** It also tracks the CISDs of your current chart (Level 0) so you can align micro structure with macro structure.
**3. Invalidation and Chart Cleanliness (Mitigation)**
To keep your chart clean and relevant, the script uses strict invalidation rules:
* When a CISD is formed, the script remembers the absolute extreme of that move (the lowest low for a bullish CISD, or the highest high for a bearish CISD).
* **Automatic Deletion:** If price comes back and breaks that extreme (sweeps the low/high that created the CISD), the setup is considered **invalidated**. The indicator will instantly delete the line and label from your chart, leaving only the active, unviolated CISD levels.
**4. Visual Customization & Labels**
* **Labels:** The indicator automatically tags the lines with labels like `CISD ▲ 1H` or `CISD ▼ 4H` so you know exactly which timeframe caused the shift in delivery.
* **Styling:** You can fully customize the thickness of the lines, change them to Solid, Dashed, or Dotted, and adjust the Bullish/Bearish colors for up to 3 different levels (Current TF, HTF Level 1, and HTF Level 2).
**In summary:** This is an algorithmic structure tracker. It eliminates the need to constantly switch between timeframes to find where the market shifted its state of delivery. It plots macro CISD levels on your micro charts automatically, and removes them when they are no longer valid, keeping you aligned with the Higher Timeframe institutional order flow.
Here is a detailed breakdown of what this indicator does and its main features:
**1. Core Concept: CISD (Change in State of Delivery)**
In ICT theory, a "State of Delivery" refers to consecutive candles moving in the same direction (e.g., a series of down candles meaning the algorithm is delivering sell-side price). A **CISD** occurs when the market shifts this state:
* **Bullish CISD:** Occurs when price closes *above the opening price* of the last bearish delivery sequence. It signals that the market has shifted from selling to buying. The script plots a Blue line at this key level.
* **Bearish CISD:** Occurs when price closes *below the opening price* of the last bullish delivery sequence. It signals a shift from buying to selling. The script plots a Red line at this level.
These lines act as highly sensitive institutional support and resistance levels.
**2. Fractal Higher Timeframe (HTF) System**
Instead of just looking at the chart you have open, the indicator runs the CISD logic on multiple timeframes simultaneously:
* **Fractal Mode (Automatic):** It dynamically calculates the appropriate higher timeframes based on the chart you are viewing. For example, if you are on a 1-minute chart, it might look for 15m CISDs; if you are on a 5-minute chart, it looks for 1H and Daily CISDs.
* **Fixed Modes:** You can override the automatic system and force the indicator to *only* look for CISDs on the **1 Hour**, **4 Hour**, or **1H + 4H** timeframes, regardless of what chart you are looking at.
* **Current Timeframe:** It also tracks the CISDs of your current chart (Level 0) so you can align micro structure with macro structure.
**3. Invalidation and Chart Cleanliness (Mitigation)**
To keep your chart clean and relevant, the script uses strict invalidation rules:
* When a CISD is formed, the script remembers the absolute extreme of that move (the lowest low for a bullish CISD, or the highest high for a bearish CISD).
* **Automatic Deletion:** If price comes back and breaks that extreme (sweeps the low/high that created the CISD), the setup is considered **invalidated**. The indicator will instantly delete the line and label from your chart, leaving only the active, unviolated CISD levels.
**4. Visual Customization & Labels**
* **Labels:** The indicator automatically tags the lines with labels like `CISD ▲ 1H` or `CISD ▼ 4H` so you know exactly which timeframe caused the shift in delivery.
* **Styling:** You can fully customize the thickness of the lines, change them to Solid, Dashed, or Dotted, and adjust the Bullish/Bearish colors for up to 3 different levels (Current TF, HTF Level 1, and HTF Level 2).
**In summary:** This is an algorithmic structure tracker. It eliminates the need to constantly switch between timeframes to find where the market shifted its state of delivery. It plots macro CISD levels on your micro charts automatically, and removes them when they are no longer valid, keeping you aligned with the Higher Timeframe institutional order flow.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.