OPEN-SOURCE SCRIPT
Liquidity Sweep & Reversal — Body Anchored + Risk (v6)

Overview
The Liquidity Sweep & Reversal — Locked to Price (v6) indicator identifies liquidity sweeps around major swing highs and lows, confirming reversals when price closes back inside the swept level.
All signals are locked to price (bottom of green candle for BUY, top of red candle for SELL), so they remain perfectly aligned when zooming or scaling.
This indicator is ideal for swing traders and scalpers who trade reversals, liquidity events, and reclaim structures.
How It Works
Detects confirmed swing highs and lows using a pivot-based structure.
Waits for a liquidity sweep — when price wicks beyond a recent swing.
Confirms a reclaim when price closes back inside the previous swing level.
Triggers a BUY or SELL signal anchored to the candle body.
Automatically calculates stop loss and risk using ATR and your inputs.
Input Settings
Swing Detection
Swing Detection Strength: How many bars confirm a swing pivot. Higher = stronger swings.
Bars to Confirm Reclaim: Number of bars after a sweep for price to close back within the swing zone.
Swing Proximity %: How close price must come to a swing to count as a liquidity sweep.
Trend Filter (optional)
Use EMA Trend Filter: When enabled, only BUY in uptrend and SELL in downtrend.
Fast EMA Length / Slow EMA Length: Define EMAs used to detect trend direction.
Risk & Stop Management
ATR Length: Period for ATR calculation (volatility measurement).
Base ATR Stop Buffer (x ATR): Distance of stop loss from entry based on ATR multiplier.
Position Size (quote units): Your total position size in quote currency (e.g., USDT).
Risk % of (Position / 20): Defines how much of your position to risk per trade.
Example: (Position / 20) × Risk % = per-trade risk.
Chart Elements
BUY Arrow (green): Appears after a liquidity sweep and reclaim near a swing low.
SELL Arrow (red): Appears after a sweep and reclaim near a swing high.
Labels: Display entry price, stop loss (SL), and calculated risk dollar value.
EMAs: Optional fast/slow moving averages for directional bias.
Dynamic Stops: Adjust automatically using ATR × risk settings.
Trading Tips
Use BUY signals near liquidity sweeps under swing lows.
Use SELL signals near liquidity sweeps above swing highs.
Adjust swing length for different timeframes:
Lower values for scalping (3–5)
Higher values for swing trading (7–10)
Respect stop loss levels and use risk control settings for consistent sizing.
Combine with volume, OBV, or structure for confirmation.
Alerts
BUY — Locked to Price: "BUY: swing low reclaimed with dynamic stop."
SELL — Locked to Price: "SELL: swing high reclaimed with dynamic stop."
Best Use Cases
Liquidity-based reversals
Swing entry confirmation
Stop hunt reclaims
Structure-based entries
Author
Created by roccodallas
For traders who value clean structure, risk control, and chart precision.
The Liquidity Sweep & Reversal — Locked to Price (v6) indicator identifies liquidity sweeps around major swing highs and lows, confirming reversals when price closes back inside the swept level.
All signals are locked to price (bottom of green candle for BUY, top of red candle for SELL), so they remain perfectly aligned when zooming or scaling.
This indicator is ideal for swing traders and scalpers who trade reversals, liquidity events, and reclaim structures.
How It Works
Detects confirmed swing highs and lows using a pivot-based structure.
Waits for a liquidity sweep — when price wicks beyond a recent swing.
Confirms a reclaim when price closes back inside the previous swing level.
Triggers a BUY or SELL signal anchored to the candle body.
Automatically calculates stop loss and risk using ATR and your inputs.
Input Settings
Swing Detection
Swing Detection Strength: How many bars confirm a swing pivot. Higher = stronger swings.
Bars to Confirm Reclaim: Number of bars after a sweep for price to close back within the swing zone.
Swing Proximity %: How close price must come to a swing to count as a liquidity sweep.
Trend Filter (optional)
Use EMA Trend Filter: When enabled, only BUY in uptrend and SELL in downtrend.
Fast EMA Length / Slow EMA Length: Define EMAs used to detect trend direction.
Risk & Stop Management
ATR Length: Period for ATR calculation (volatility measurement).
Base ATR Stop Buffer (x ATR): Distance of stop loss from entry based on ATR multiplier.
Position Size (quote units): Your total position size in quote currency (e.g., USDT).
Risk % of (Position / 20): Defines how much of your position to risk per trade.
Example: (Position / 20) × Risk % = per-trade risk.
Chart Elements
BUY Arrow (green): Appears after a liquidity sweep and reclaim near a swing low.
SELL Arrow (red): Appears after a sweep and reclaim near a swing high.
Labels: Display entry price, stop loss (SL), and calculated risk dollar value.
EMAs: Optional fast/slow moving averages for directional bias.
Dynamic Stops: Adjust automatically using ATR × risk settings.
Trading Tips
Use BUY signals near liquidity sweeps under swing lows.
Use SELL signals near liquidity sweeps above swing highs.
Adjust swing length for different timeframes:
Lower values for scalping (3–5)
Higher values for swing trading (7–10)
Respect stop loss levels and use risk control settings for consistent sizing.
Combine with volume, OBV, or structure for confirmation.
Alerts
BUY — Locked to Price: "BUY: swing low reclaimed with dynamic stop."
SELL — Locked to Price: "SELL: swing high reclaimed with dynamic stop."
Best Use Cases
Liquidity-based reversals
Swing entry confirmation
Stop hunt reclaims
Structure-based entries
Author
Created by roccodallas
For traders who value clean structure, risk control, and chart precision.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.