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が提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。