OPEN-SOURCE SCRIPT
Delivery Shift CISD [Viprasol]

Overview
This indicator is based on an open-source "Change in State of Delivery (CISD)" community script, which detects the ICT concept of a delivery shift — the moment price reverses and closes back through the opening level of the opposing momentum leg that produced it. The original tracks swing-point liquidity, detects bullish and bearish CISD events using a displacement-ratio test, marks the origin level, and flags "strong" CISDs that occur right after opposing liquidity is swept. This version keeps that detection engine intact and adds a Viprasol confluence and execution layer: a 0-4 confluence score with A/B/C grading, optional volume-surge and higher-timeframe bias filters, a signal cooldown, a minimum-score gate, and an ATR-anchored Entry/SL/TP risk overlay drawn on qualified signals.
It is built for ICT/SMC traders who use CISD as a confirmation of intraday delivery direction and want each event graded by confluence, with optional filters and an automatic risk projection.
How It Works
Swing Liquidity (from original):
Pivot highs and lows over the swing period create horizontal liquidity lines that extend forward each bar. A line is mitigated when price trades through it (high >= level for a high, low <= level for a low) on a confirmed bar, and removed; lines older than the expiry threshold stop updating. The most recently mitigated high and low, and how many bars ago they were taken, are retained for the sweep test below.
CISD Detection (from original):
When a candle flips color (a down candle followed by an up candle, or vice versa), its open is stored as a potential CISD origin along with its bar index. On each later bar the script checks whether price has closed back beyond that stored open. If it has, it measures the displacement of the leg as a ratio: for a bearish CISD, (highest close in the leg − origin open) / (top of the bearish run − origin open). If that ratio exceeds the Noise Filter, the event qualifies as a CISD, the origin level is drawn, and the trend state flips. Weaker candidates are discarded and the scan continues to older candidates.
Liquidity-Sweep Confluence (from original):
A CISD is flagged "strong" when it fires within the liquidity-lookback window after the opposing liquidity was swept — a bearish CISD where a swing high was just taken and price closed back below it, or a bullish CISD where a swing low was taken and price closed back above. These print the labeled sweep arrows.
Confluence Score & Grade (new):
Every CISD event is scored 0-4 by summing four independent confluence checks:
score = strongDisplacement? + liquiditySweep? + htfAligned? + volumeSurge?
- strongDisplacement = the measured ratio is at least halfway between the Noise Filter and 1.0 (a decisively strong leg, not a marginal one).
- liquiditySweep = the original sweep confluence is present.
- htfAligned = the CISD direction agrees with the higher-timeframe EMA.
- volumeSurge = volume on the CISD bar exceeds its rolling average × the multiplier.
The score maps to a grade — A (>= 3), B (= 2), C (<= 1) — labeled at the origin level.
Filters & Qualified Signals (new):
Four optional gates can be applied without altering the original CISD drawing: a volume-surge requirement, a higher-timeframe EMA bias (bull only above, bear only below), a per-signal cooldown (minimum bars between qualified signals), and a minimum-confluence-score requirement. A CISD that passes all active gates becomes a "qualified" signal, which is what the risk overlay and the two new qualified alerts use. With every gate at its default (cooldown 0, filters off, min score 0), every CISD qualifies and the original behaviour is unchanged.
Risk Overlay (new):
On a qualified CISD, the script projects three lines: Entry at the CISD origin level, Stop-Loss beyond the CISD swing extreme (the highest/lowest close captured during detection) plus an ATR buffer, and Take-Profit at Entry ± risk × the Risk:Reward ratio, where risk is the Entry-to-SL distance. Colored ENTRY/SL/TP price labels mark the line ends. Only the most recent qualified signal's projection is kept, to avoid clutter.
What Is Original (Viprasol Additions)
1. Confluence score (0-4) and A/B/C grade per CISD, from displacement strength, liquidity sweep, HTF alignment, and volume surge.
2. Minimum-confluence-score gate and the "qualified signal" concept layered on top of raw CISD detection.
3. Optional volume-surge filter (volume above its rolling average × multiplier on the CISD bar).
4. Optional higher-timeframe EMA bias filter (and an always-computed HTF read used for grading).
5. Per-signal cooldown to prevent qualified-signal clustering.
6. ATR-anchored Entry/SL/TP risk overlay with colored price labels, with the stop anchored to the CISD swing extreme.
Key Features
From the Original:
- Swing-point liquidity lines with forward extension, mitigation, and expiry
- Displacement-ratio CISD detection for both directions with a Noise Filter
- Origin-level lines drawn on each CISD
- Trend/delivery-state tracking
- Liquidity-sweep confluence with labeled strong-CISD arrows
- Swing-high / swing-low dots
- Trend-gradient candle coloring
Added in This Version (Viprasol):
- 0-4 confluence score with A/B/C grade label
- Minimum-score gate and qualified-signal logic
- Volume-surge filter, HTF EMA bias filter, and signal cooldown
- ATR-anchored Entry/SL/TP risk overlay with price labels
- Info dashboard (delivery state, last grade, sweep, HTF bias, volume, live liquidity counts)
- Two new alerts for qualified bull/bear signals; all alert messages made dynamic
How to Use
Getting Started:
1. Add to a standard candlestick chart (not Heikin Ashi).
2. With defaults, every CISD is drawn and graded — read the A/B/C label to judge each event's confluence.
3. To trade only stronger setups, raise the Minimum Confluence Score or enable the volume / HTF filters.
Reading the Chart:
- Candles tint green/red with the current delivery state.
- A thick green/red horizontal line marks a CISD origin level; the A/B/C label shows its grade.
- ▲/▼ arrows mark strong CISDs that followed an opposing liquidity sweep.
- On a qualified CISD (with SL/TP enabled), Entry/SL/TP lines and price labels project to the right.
Recommended Starting Points:
- Intraday (1m-15m): Swing Period 10-12, Noise Filter 0.6-0.7, Min Score 0-1
- Swing (1H-4H): Swing Period 15-20, Noise Filter 0.7-0.8, Min Score 2, enable HTF bias
- Higher conviction: Min Score 3 (grade A), or require volume surge + HTF bias
These are starting points only — every market and timeframe behaves differently. Backtest and adjust before trading live.
Settings
Calculations: Noise Filter (displacement ratio threshold), Swing Period, Expiry Bars, Liquidity Lookback.
Signal Filters (Viprasol): signal cooldown, volume-surge requirement (length + multiplier), and HTF EMA bias (resolution + length).
Confluence & Quality (Viprasol): show grade on CISD, minimum confluence score.
Risk Overlay (Viprasol): show SL/TP on qualified CISD, show price labels, ATR period, SL ATR buffer, Risk:Reward.
Appearance: bullish/bearish colors, candle body and wick transparency, hide expired levels, hide mitigated levels.
Dashboard / Display: dashboard toggle and position.
Alerts
1. Swing High Mitigation — a swing-high liquidity line was taken
2. Swing Low Mitigation — a swing-low liquidity line was taken
3. Bearish CISD — a bearish change in state of delivery fired
4. Bullish CISD — a bullish change in state of delivery fired
5. Strong Bearish (Sweep) — bearish CISD following an opposing liquidity sweep
6. Strong Bullish (Sweep) — bullish CISD following an opposing liquidity sweep
7. Qualified Bull — a bullish CISD that passed all active filters and the score gate
8. Qualified Bear — a bearish CISD that passed all active filters and the score gate
All alerts include {{ticker}}, {{close}}, and {{interval}} for dynamic notification messages.
Limitations & Disclaimer
- CISD detection scans backward through stored candidate origins and uses closing relationships; signals are evaluated as bars confirm and the displacement ratio is measured after the move.
- The HTF EMA bias uses request.security with lookahead disabled; HTF values update only as the higher-timeframe bar develops.
- Swing liquidity lines are capped (oldest pruned) and can expire; in fast markets some mitigations may occur off-screen relative to the visible levels.
- The risk overlay's stop is anchored to the captured swing extreme plus an ATR buffer — it is a mechanical projection, not an optimized stop, and the lines are visual references only; they do not place or manage trades.
- Filters and the minimum-score gate reduce the number of qualified signals; in choppy conditions valid CISDs may not qualify, while with all gates off qualified signals equal raw CISDs.
- Past performance does not guarantee future results. This indicator is for educational and analytical purposes only and is not financial advice. Always use proper risk management and test on historical data before trading live.
Credits & Attribution
Based on an open-source "Change in State of Delivery (CISD)" community indicator, which provided the swing-point liquidity lines with extension/mitigation/expiry, the displacement-ratio CISD detection for both directions, the origin-level drawing, the trend/delivery-state tracking, the liquidity-sweep confluence with labeled strong-CISD arrows, the swing dots, and the trend-gradient candle coloring. CISD is an Inner Circle Trader (ICT) concept. Added by Viprasol: the 0-4 confluence score and A/B/C grading, the minimum-score gate and qualified-signal logic, the volume-surge and HTF EMA bias filters, the signal cooldown, the ATR-anchored Entry/SL/TP risk overlay with colored price labels, the info dashboard, and the two additional qualified-signal alerts with dynamic messages.
Published open-source per TradingView House Rules.
This indicator is based on an open-source "Change in State of Delivery (CISD)" community script, which detects the ICT concept of a delivery shift — the moment price reverses and closes back through the opening level of the opposing momentum leg that produced it. The original tracks swing-point liquidity, detects bullish and bearish CISD events using a displacement-ratio test, marks the origin level, and flags "strong" CISDs that occur right after opposing liquidity is swept. This version keeps that detection engine intact and adds a Viprasol confluence and execution layer: a 0-4 confluence score with A/B/C grading, optional volume-surge and higher-timeframe bias filters, a signal cooldown, a minimum-score gate, and an ATR-anchored Entry/SL/TP risk overlay drawn on qualified signals.
It is built for ICT/SMC traders who use CISD as a confirmation of intraday delivery direction and want each event graded by confluence, with optional filters and an automatic risk projection.
How It Works
Swing Liquidity (from original):
Pivot highs and lows over the swing period create horizontal liquidity lines that extend forward each bar. A line is mitigated when price trades through it (high >= level for a high, low <= level for a low) on a confirmed bar, and removed; lines older than the expiry threshold stop updating. The most recently mitigated high and low, and how many bars ago they were taken, are retained for the sweep test below.
CISD Detection (from original):
When a candle flips color (a down candle followed by an up candle, or vice versa), its open is stored as a potential CISD origin along with its bar index. On each later bar the script checks whether price has closed back beyond that stored open. If it has, it measures the displacement of the leg as a ratio: for a bearish CISD, (highest close in the leg − origin open) / (top of the bearish run − origin open). If that ratio exceeds the Noise Filter, the event qualifies as a CISD, the origin level is drawn, and the trend state flips. Weaker candidates are discarded and the scan continues to older candidates.
Liquidity-Sweep Confluence (from original):
A CISD is flagged "strong" when it fires within the liquidity-lookback window after the opposing liquidity was swept — a bearish CISD where a swing high was just taken and price closed back below it, or a bullish CISD where a swing low was taken and price closed back above. These print the labeled sweep arrows.
Confluence Score & Grade (new):
Every CISD event is scored 0-4 by summing four independent confluence checks:
score = strongDisplacement? + liquiditySweep? + htfAligned? + volumeSurge?
- strongDisplacement = the measured ratio is at least halfway between the Noise Filter and 1.0 (a decisively strong leg, not a marginal one).
- liquiditySweep = the original sweep confluence is present.
- htfAligned = the CISD direction agrees with the higher-timeframe EMA.
- volumeSurge = volume on the CISD bar exceeds its rolling average × the multiplier.
The score maps to a grade — A (>= 3), B (= 2), C (<= 1) — labeled at the origin level.
Filters & Qualified Signals (new):
Four optional gates can be applied without altering the original CISD drawing: a volume-surge requirement, a higher-timeframe EMA bias (bull only above, bear only below), a per-signal cooldown (minimum bars between qualified signals), and a minimum-confluence-score requirement. A CISD that passes all active gates becomes a "qualified" signal, which is what the risk overlay and the two new qualified alerts use. With every gate at its default (cooldown 0, filters off, min score 0), every CISD qualifies and the original behaviour is unchanged.
Risk Overlay (new):
On a qualified CISD, the script projects three lines: Entry at the CISD origin level, Stop-Loss beyond the CISD swing extreme (the highest/lowest close captured during detection) plus an ATR buffer, and Take-Profit at Entry ± risk × the Risk:Reward ratio, where risk is the Entry-to-SL distance. Colored ENTRY/SL/TP price labels mark the line ends. Only the most recent qualified signal's projection is kept, to avoid clutter.
What Is Original (Viprasol Additions)
1. Confluence score (0-4) and A/B/C grade per CISD, from displacement strength, liquidity sweep, HTF alignment, and volume surge.
2. Minimum-confluence-score gate and the "qualified signal" concept layered on top of raw CISD detection.
3. Optional volume-surge filter (volume above its rolling average × multiplier on the CISD bar).
4. Optional higher-timeframe EMA bias filter (and an always-computed HTF read used for grading).
5. Per-signal cooldown to prevent qualified-signal clustering.
6. ATR-anchored Entry/SL/TP risk overlay with colored price labels, with the stop anchored to the CISD swing extreme.
Key Features
From the Original:
- Swing-point liquidity lines with forward extension, mitigation, and expiry
- Displacement-ratio CISD detection for both directions with a Noise Filter
- Origin-level lines drawn on each CISD
- Trend/delivery-state tracking
- Liquidity-sweep confluence with labeled strong-CISD arrows
- Swing-high / swing-low dots
- Trend-gradient candle coloring
Added in This Version (Viprasol):
- 0-4 confluence score with A/B/C grade label
- Minimum-score gate and qualified-signal logic
- Volume-surge filter, HTF EMA bias filter, and signal cooldown
- ATR-anchored Entry/SL/TP risk overlay with price labels
- Info dashboard (delivery state, last grade, sweep, HTF bias, volume, live liquidity counts)
- Two new alerts for qualified bull/bear signals; all alert messages made dynamic
How to Use
Getting Started:
1. Add to a standard candlestick chart (not Heikin Ashi).
2. With defaults, every CISD is drawn and graded — read the A/B/C label to judge each event's confluence.
3. To trade only stronger setups, raise the Minimum Confluence Score or enable the volume / HTF filters.
Reading the Chart:
- Candles tint green/red with the current delivery state.
- A thick green/red horizontal line marks a CISD origin level; the A/B/C label shows its grade.
- ▲/▼ arrows mark strong CISDs that followed an opposing liquidity sweep.
- On a qualified CISD (with SL/TP enabled), Entry/SL/TP lines and price labels project to the right.
Recommended Starting Points:
- Intraday (1m-15m): Swing Period 10-12, Noise Filter 0.6-0.7, Min Score 0-1
- Swing (1H-4H): Swing Period 15-20, Noise Filter 0.7-0.8, Min Score 2, enable HTF bias
- Higher conviction: Min Score 3 (grade A), or require volume surge + HTF bias
These are starting points only — every market and timeframe behaves differently. Backtest and adjust before trading live.
Settings
Calculations: Noise Filter (displacement ratio threshold), Swing Period, Expiry Bars, Liquidity Lookback.
Signal Filters (Viprasol): signal cooldown, volume-surge requirement (length + multiplier), and HTF EMA bias (resolution + length).
Confluence & Quality (Viprasol): show grade on CISD, minimum confluence score.
Risk Overlay (Viprasol): show SL/TP on qualified CISD, show price labels, ATR period, SL ATR buffer, Risk:Reward.
Appearance: bullish/bearish colors, candle body and wick transparency, hide expired levels, hide mitigated levels.
Dashboard / Display: dashboard toggle and position.
Alerts
1. Swing High Mitigation — a swing-high liquidity line was taken
2. Swing Low Mitigation — a swing-low liquidity line was taken
3. Bearish CISD — a bearish change in state of delivery fired
4. Bullish CISD — a bullish change in state of delivery fired
5. Strong Bearish (Sweep) — bearish CISD following an opposing liquidity sweep
6. Strong Bullish (Sweep) — bullish CISD following an opposing liquidity sweep
7. Qualified Bull — a bullish CISD that passed all active filters and the score gate
8. Qualified Bear — a bearish CISD that passed all active filters and the score gate
All alerts include {{ticker}}, {{close}}, and {{interval}} for dynamic notification messages.
Limitations & Disclaimer
- CISD detection scans backward through stored candidate origins and uses closing relationships; signals are evaluated as bars confirm and the displacement ratio is measured after the move.
- The HTF EMA bias uses request.security with lookahead disabled; HTF values update only as the higher-timeframe bar develops.
- Swing liquidity lines are capped (oldest pruned) and can expire; in fast markets some mitigations may occur off-screen relative to the visible levels.
- The risk overlay's stop is anchored to the captured swing extreme plus an ATR buffer — it is a mechanical projection, not an optimized stop, and the lines are visual references only; they do not place or manage trades.
- Filters and the minimum-score gate reduce the number of qualified signals; in choppy conditions valid CISDs may not qualify, while with all gates off qualified signals equal raw CISDs.
- Past performance does not guarantee future results. This indicator is for educational and analytical purposes only and is not financial advice. Always use proper risk management and test on historical data before trading live.
Credits & Attribution
Based on an open-source "Change in State of Delivery (CISD)" community indicator, which provided the swing-point liquidity lines with extension/mitigation/expiry, the displacement-ratio CISD detection for both directions, the origin-level drawing, the trend/delivery-state tracking, the liquidity-sweep confluence with labeled strong-CISD arrows, the swing dots, and the trend-gradient candle coloring. CISD is an Inner Circle Trader (ICT) concept. Added by Viprasol: the 0-4 confluence score and A/B/C grading, the minimum-score gate and qualified-signal logic, the volume-surge and HTF EMA bias filters, the signal cooldown, the ATR-anchored Entry/SL/TP risk overlay with colored price labels, the info dashboard, and the two additional qualified-signal alerts with dynamic messages.
Published open-source per TradingView House Rules.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Viprasol We solve Infinity
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
Viprasol We solve Infinity
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。