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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.