OPEN-SOURCE SCRIPT
CISD after Sweep or Fractal Rays CISD

CISD after Sweep — Fractal Rays + CISD
This indicator maps out swing-point liquidity sweeps and the "Change in State of Delivery" (CISD) reactions that follow them.
How it works
Fractal rays — the script marks swing highs/lows using a standard fractal (N bars on each side). Each fractal is drawn as a horizontal ray from its bar forward, and its state is tracked live:
Untested — price hasn't reached the level yet
Tested — price wicked into the level but the candle body didn't close through it
Broken — a candle closed through the level (ray stops at the break)
An optional 2-candle reversal rule can downgrade what looks like a break back to "tested" if the very next candle closes back on the safe side of the level.
CISD detection — once a fractal is wick-tested (swept), the script scans back over the recent candles for the last displacement candle in the opposite direction (a bearish candle closing below the sweep's low for a swept high, or a bullish candle closing above the sweep's high for a swept low). That candle's close becomes a CISD level:
Drawn as a dashed, faded line while pending
Turns solid once price closes back through the CISD level (confirmed shift in delivery)
Removed if price instead closes back through the original fractal price first (invalidated)
Inputs
Fractal period, history depth, and broken-ray display limit
Independent color/width/style controls for untested, tested, and broken rays
CISD scan depth, line width, label toggle, bullish/bearish colors, and pending-line opacity
Optional 2-candle tested-reversal rule
Anti-blink option that defers break verdicts until the forming candle closes, so lines don't flicker between states intra-bar
Notes
All levels are read from confirmed price action only (or the forming candle's wick, where noted) — nothing is calculated from future data.
Ray extension and CISD-level scan depth are both bar-limited for performance; very old fractals beyond the "Max Candles Back" setting are not tracked.
This is a structure/context tool, not a standalone signal generator — combine it with your own entry and risk criteria.
This indicator maps out swing-point liquidity sweeps and the "Change in State of Delivery" (CISD) reactions that follow them.
How it works
Fractal rays — the script marks swing highs/lows using a standard fractal (N bars on each side). Each fractal is drawn as a horizontal ray from its bar forward, and its state is tracked live:
Untested — price hasn't reached the level yet
Tested — price wicked into the level but the candle body didn't close through it
Broken — a candle closed through the level (ray stops at the break)
An optional 2-candle reversal rule can downgrade what looks like a break back to "tested" if the very next candle closes back on the safe side of the level.
CISD detection — once a fractal is wick-tested (swept), the script scans back over the recent candles for the last displacement candle in the opposite direction (a bearish candle closing below the sweep's low for a swept high, or a bullish candle closing above the sweep's high for a swept low). That candle's close becomes a CISD level:
Drawn as a dashed, faded line while pending
Turns solid once price closes back through the CISD level (confirmed shift in delivery)
Removed if price instead closes back through the original fractal price first (invalidated)
Inputs
Fractal period, history depth, and broken-ray display limit
Independent color/width/style controls for untested, tested, and broken rays
CISD scan depth, line width, label toggle, bullish/bearish colors, and pending-line opacity
Optional 2-candle tested-reversal rule
Anti-blink option that defers break verdicts until the forming candle closes, so lines don't flicker between states intra-bar
Notes
All levels are read from confirmed price action only (or the forming candle's wick, where noted) — nothing is calculated from future data.
Ray extension and CISD-level scan depth are both bar-limited for performance; very old fractals beyond the "Max Candles Back" setting are not tracked.
This is a structure/context tool, not a standalone signal generator — combine it with your own entry and risk criteria.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。