OPEN-SOURCE SCRIPT
Liquidity Sweep + CISD + FVG Reversal

Liquidity Sweep + CISD + FVG Reversal
What this is — and is not. This is one sequence machine, not three ICT tools stacked on a chart. A liquidity-pool tracker, a change-in-state-of-delivery confirmation, a fair value gap entry zone and a quality-scoring engine are chained so that each stage only exists because the previous one fired. It is not a sweep indicator with gaps drawn next to it, and it is not an FVG tool with sweep markers bolted on. No stage is a signal on its own; only the completed sequence fires.
Why the parts are inseparable. The CISD is measured against the delivery run that produced the sweep — remove the sweep and there is no run whose state can change. The gap is hunted only inside the displacement that follows the CISD — remove the CISD and there is no displacement to scan. The entry is a retrace into that specific gap with a confirmed rejection — remove the gap and there is nothing to retrace into. And the quality engine scores properties of the completed sequence itself — how many highs or lows stack at the swept level, how much force the CISD candle carried, where the setup sits in the dealing range, how deep the sweep penetrated, and how efficiently price approached the pool. None of those measurements exist until the sequence exists. Take any stage away and the remaining logic has nothing to act on.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE SEQUENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 — POOLS. Swing pivots are confirmed with a configurable length, and the most recent unswept swing high and swing low are tracked as the resting liquidity pools — buy-side above, sell-side below. Levels expire after a maximum age so a stale pivot from hundreds of bars ago cannot anchor a setup.
2 — SWEEP. A pool is swept when price wicks through it and closes back inside. Resting orders were taken, not genuinely broken. The sweep opens a candidate setup, marks the raid with a zone, and starts a strict countdown.
3 — CISD. Within a configurable window, price must close through the opening price of the delivery run that swept the pool — the change in state of delivery. No CISD inside the window and the setup dies quietly, because a sweep that produces no state change was absorption, not a raid. The CISD candle's body is also measured against ATR: a state change is supposed to arrive with force, so a doji drifting through the level is recorded but scores nothing for displacement.
4 — FAIR VALUE GAP. The displacement that delivered the CISD is scanned for a gap of at least a configurable ATR fraction. When one qualifies, the zone is drawn with its consequent-encroachment midline, the dashboard flips to FVG SET, and the machine waits.
5 — ENTRY. Price must retrace into the gap within a configurable window and reject on a confirmed bar. That rejection is the signal — not the sweep, not the CISD, not the gap forming. A retrace that never comes, or a close that blows through the gap, retires the setup without a trade.
6 — GRADE. Every completed setup is scored 0–100 across five independent measures and stamped A, B or C, printed on the entry label and in the dashboard. Pool quality counts how many equal highs or lows stack at the swept level — two or more touches is where stops actually accumulate, and a three-touch pool outranks a lone pivot. Displacement scores the CISD body against ATR. Array context scores position in the dealing range — shorts want premium, longs want discount. Sweep cleanliness caps penetration depth, because a spear far beyond the pool is a failed breakout, not a raid. And approach efficiency measures the path into the sweep with an efficiency ratio: price that drifted sideways and then wicked through a pool was raided, while a clean one-way leg into the level is a trend arriving — the engine can downgrade those setups, skip them, or take the other side, at your choice. By default everything is measured and nothing is filtered: raise the minimum grade when you want the engine to be selective, and watch what you would be filtering before you filter it.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
READING THE DASHBOARD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The bottom-center panel is the machine's cockpit, one cell per subsystem, updating on confirmed bars:
STAGE — where the sequence stands right now: SCANNING, SWEPT, CISD, or FVG SET. This cell alone tells you whether the machine is hunting or waiting.
HUNT — the direction being stalked once a sweep registers: SHORT HUNT after a buy-side raid, LONG HUNT after a sell-side raid.
BSL / SSL — the tracked buy-side and sell-side pool prices currently on watch.
GRADE — the live quality score with its letter, plus a compact readout of the raw measures behind it (pool touches, displacement, penetration, range position, approach efficiency), so you can see why a setup earned its grade, not just what it earned.
CISD — the delivery-run open being watched, a checkmark when the close-through confirms, and the countdown window.
FVG — the qualified gap's boundaries and the remaining retrace window.
POSITION / TP·SL — flat or in a trade, with the working exit levels and the configured exit percentages.
RECORD — a running tally of how past signals on the chart resolved, maintained as a study aid so you can review the machine's behavior on your instrument and settings.
STATUS — READY, in-trade, or cooldown with bars remaining.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CHART WALKTHROUGH — MNQ 5-MINUTE, TWO MOMENTS OF ONE SETUP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

SCREENSHOT 1 — THE TRAP BUILDS. Price rallies through the morning and spears the buy-side pool near 29,480 — the purple zone with the SWEEP marker. The wick trades through the tracked high and the candle closes back inside: buy stops above the pool were collected, and the machine opens a candidate. Within its window, price then closes down through the opening price of the run that made the raid — the gold CISD line at 29,420.75, checkmarked in the dashboard. The displacement leg that delivered that close left an imbalance at 29,425.50–29,426.50, drawn as the FVG zone extending right. At this moment the dashboard reads the whole story in one row: STAGE — FVG SET, HUNT — SHORT ▼, the sell-side pool tracked at 29,398.50 below, GRADE — B with its measures broken out beside it, and POSITION — FLAT. Nothing has fired. The machine has identified the raid, confirmed the state change, framed the entry zone, and is now doing the one thing most tools cannot: waiting.

SCREENSHOT 2 — THE RESOLUTION. Price retraces upward into the gap and rejects on a confirmed bar — and only now does the entry print: SHORT at 29,386.50, grade stamped on the label, with the full trade frame drawn the moment it fires. The red zone above spans entry to the protective stop at 29,477.50 — placed beyond the swept pool itself, because if price reclaims the raided high the entire thesis is invalid. The teal zone below spans entry to the target at 29,319.00, this example running the fixed-percentage exit mode shown in the TP/SL cell. Price breaks away from the gap, cascades through the profit zone, and tags the target — the exit label printing the realized result on the bar where it happened. Behind it, the dashboard has already moved on: STAGE back to SCANNING, STATUS in cooldown, the completed setup's graphics faded in place as a permanent record of what fired and why. One raid, one state change, one gap, one rejection, one trade — start to finish on the chart with nothing repainted and nothing hidden.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Structure — pivot length, level age, sweep-to-CISD window. CISD + FVG — minimum gap size (ATR fraction), retrace window, midline toggle. Quality engine — equal-level tolerance and lookback, displacement threshold, premium/discount requirement, penetration cap, approach-efficiency threshold and its response mode (downgrade, skip, or flip), minimum grade to signal, grade-on-label toggle. Trade management — structural or fixed-percent exits, risk multiple, stop buffer past the wick, cooldown, max bars in trade, optional end-of-day flatten window. Webhook — optional JSON payload on entry and exit with a strategy identifier.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Apply to a liquid instrument on a timeframe you know, leave the grade filter open, and watch several sessions of the dashboard walking through SCANNING → SWEPT → CISD → FVG SET before judging anything. The grade cell teaches faster than any manual: you will see which measures your market keeps failing. Once the letter grades map to outcomes you have personally watched, raise the minimum grade to match. The defaults are a starting point, not an optimized or recommended configuration, and they are not intended to suggest any particular outcome — different instruments, timeframes and volatility conditions will call for different values.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NON-REPAINTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The entire state machine advances on confirmed bars only. Pivot detection uses right-side confirmation, so tracked levels are locked once drawn. The sweep, the CISD close, the gap qualification and the rejection entry all evaluate on closed bars, and a signal that prints does not move or disappear. No higher-timeframe requests are used anywhere in the script. What you see on historical bars is what the machine would have shown live.
What this is — and is not. This is one sequence machine, not three ICT tools stacked on a chart. A liquidity-pool tracker, a change-in-state-of-delivery confirmation, a fair value gap entry zone and a quality-scoring engine are chained so that each stage only exists because the previous one fired. It is not a sweep indicator with gaps drawn next to it, and it is not an FVG tool with sweep markers bolted on. No stage is a signal on its own; only the completed sequence fires.
Why the parts are inseparable. The CISD is measured against the delivery run that produced the sweep — remove the sweep and there is no run whose state can change. The gap is hunted only inside the displacement that follows the CISD — remove the CISD and there is no displacement to scan. The entry is a retrace into that specific gap with a confirmed rejection — remove the gap and there is nothing to retrace into. And the quality engine scores properties of the completed sequence itself — how many highs or lows stack at the swept level, how much force the CISD candle carried, where the setup sits in the dealing range, how deep the sweep penetrated, and how efficiently price approached the pool. None of those measurements exist until the sequence exists. Take any stage away and the remaining logic has nothing to act on.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE SEQUENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 — POOLS. Swing pivots are confirmed with a configurable length, and the most recent unswept swing high and swing low are tracked as the resting liquidity pools — buy-side above, sell-side below. Levels expire after a maximum age so a stale pivot from hundreds of bars ago cannot anchor a setup.
2 — SWEEP. A pool is swept when price wicks through it and closes back inside. Resting orders were taken, not genuinely broken. The sweep opens a candidate setup, marks the raid with a zone, and starts a strict countdown.
3 — CISD. Within a configurable window, price must close through the opening price of the delivery run that swept the pool — the change in state of delivery. No CISD inside the window and the setup dies quietly, because a sweep that produces no state change was absorption, not a raid. The CISD candle's body is also measured against ATR: a state change is supposed to arrive with force, so a doji drifting through the level is recorded but scores nothing for displacement.
4 — FAIR VALUE GAP. The displacement that delivered the CISD is scanned for a gap of at least a configurable ATR fraction. When one qualifies, the zone is drawn with its consequent-encroachment midline, the dashboard flips to FVG SET, and the machine waits.
5 — ENTRY. Price must retrace into the gap within a configurable window and reject on a confirmed bar. That rejection is the signal — not the sweep, not the CISD, not the gap forming. A retrace that never comes, or a close that blows through the gap, retires the setup without a trade.
6 — GRADE. Every completed setup is scored 0–100 across five independent measures and stamped A, B or C, printed on the entry label and in the dashboard. Pool quality counts how many equal highs or lows stack at the swept level — two or more touches is where stops actually accumulate, and a three-touch pool outranks a lone pivot. Displacement scores the CISD body against ATR. Array context scores position in the dealing range — shorts want premium, longs want discount. Sweep cleanliness caps penetration depth, because a spear far beyond the pool is a failed breakout, not a raid. And approach efficiency measures the path into the sweep with an efficiency ratio: price that drifted sideways and then wicked through a pool was raided, while a clean one-way leg into the level is a trend arriving — the engine can downgrade those setups, skip them, or take the other side, at your choice. By default everything is measured and nothing is filtered: raise the minimum grade when you want the engine to be selective, and watch what you would be filtering before you filter it.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
READING THE DASHBOARD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The bottom-center panel is the machine's cockpit, one cell per subsystem, updating on confirmed bars:
STAGE — where the sequence stands right now: SCANNING, SWEPT, CISD, or FVG SET. This cell alone tells you whether the machine is hunting or waiting.
HUNT — the direction being stalked once a sweep registers: SHORT HUNT after a buy-side raid, LONG HUNT after a sell-side raid.
BSL / SSL — the tracked buy-side and sell-side pool prices currently on watch.
GRADE — the live quality score with its letter, plus a compact readout of the raw measures behind it (pool touches, displacement, penetration, range position, approach efficiency), so you can see why a setup earned its grade, not just what it earned.
CISD — the delivery-run open being watched, a checkmark when the close-through confirms, and the countdown window.
FVG — the qualified gap's boundaries and the remaining retrace window.
POSITION / TP·SL — flat or in a trade, with the working exit levels and the configured exit percentages.
RECORD — a running tally of how past signals on the chart resolved, maintained as a study aid so you can review the machine's behavior on your instrument and settings.
STATUS — READY, in-trade, or cooldown with bars remaining.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CHART WALKTHROUGH — MNQ 5-MINUTE, TWO MOMENTS OF ONE SETUP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SCREENSHOT 1 — THE TRAP BUILDS. Price rallies through the morning and spears the buy-side pool near 29,480 — the purple zone with the SWEEP marker. The wick trades through the tracked high and the candle closes back inside: buy stops above the pool were collected, and the machine opens a candidate. Within its window, price then closes down through the opening price of the run that made the raid — the gold CISD line at 29,420.75, checkmarked in the dashboard. The displacement leg that delivered that close left an imbalance at 29,425.50–29,426.50, drawn as the FVG zone extending right. At this moment the dashboard reads the whole story in one row: STAGE — FVG SET, HUNT — SHORT ▼, the sell-side pool tracked at 29,398.50 below, GRADE — B with its measures broken out beside it, and POSITION — FLAT. Nothing has fired. The machine has identified the raid, confirmed the state change, framed the entry zone, and is now doing the one thing most tools cannot: waiting.
SCREENSHOT 2 — THE RESOLUTION. Price retraces upward into the gap and rejects on a confirmed bar — and only now does the entry print: SHORT at 29,386.50, grade stamped on the label, with the full trade frame drawn the moment it fires. The red zone above spans entry to the protective stop at 29,477.50 — placed beyond the swept pool itself, because if price reclaims the raided high the entire thesis is invalid. The teal zone below spans entry to the target at 29,319.00, this example running the fixed-percentage exit mode shown in the TP/SL cell. Price breaks away from the gap, cascades through the profit zone, and tags the target — the exit label printing the realized result on the bar where it happened. Behind it, the dashboard has already moved on: STAGE back to SCANNING, STATUS in cooldown, the completed setup's graphics faded in place as a permanent record of what fired and why. One raid, one state change, one gap, one rejection, one trade — start to finish on the chart with nothing repainted and nothing hidden.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Structure — pivot length, level age, sweep-to-CISD window. CISD + FVG — minimum gap size (ATR fraction), retrace window, midline toggle. Quality engine — equal-level tolerance and lookback, displacement threshold, premium/discount requirement, penetration cap, approach-efficiency threshold and its response mode (downgrade, skip, or flip), minimum grade to signal, grade-on-label toggle. Trade management — structural or fixed-percent exits, risk multiple, stop buffer past the wick, cooldown, max bars in trade, optional end-of-day flatten window. Webhook — optional JSON payload on entry and exit with a strategy identifier.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Apply to a liquid instrument on a timeframe you know, leave the grade filter open, and watch several sessions of the dashboard walking through SCANNING → SWEPT → CISD → FVG SET before judging anything. The grade cell teaches faster than any manual: you will see which measures your market keeps failing. Once the letter grades map to outcomes you have personally watched, raise the minimum grade to match. The defaults are a starting point, not an optimized or recommended configuration, and they are not intended to suggest any particular outcome — different instruments, timeframes and volatility conditions will call for different values.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NON-REPAINTING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The entire state machine advances on confirmed bars only. Pivot detection uses right-side confirmation, so tracked levels are locked once drawn. The sweep, the CISD close, the gap qualification and the rejection entry all evaluate on closed bars, and a signal that prints does not move or disappear. No higher-timeframe requests are used anywhere in the script. What you see on historical bars is what the machine would have shown live.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
This INDICATOR to STRATEGY to LIVE Trading
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
This INDICATOR to STRATEGY to LIVE Trading
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.