by damianpitt· code credited to Capital41 | MIT License
The Capital41 Liquidity Sweep Simple indicator detects liquidity sweeps where price breaks a recent swing high or low then closes back inside the range with volume confirmation.
// Copyright (c) 2026 Capital41 | MIT License
// CAPITAL41 LIQUIDITY SWEEP SIMPLE
// What it does:
// - Detects liquidity sweeps where price breaks a recent swing level and closes
// back inside the range with above-average volume.
// - Marks single sweeps and optional consecutive sweeps at similar levels.
// - Non-repainting: signals only after bar close.
//
// TradingView setup:
// 1) Open TradingView -> Pine Editor.
// 2) Paste this script, Save, and Add to chart.
// 3) Use 30m or 4h on BTC or US stocks.
// 4) Adjust inputs if you want more or fewer signals.
//
// Usage guide (30m/4h):
// - Long: bullish sweep near support or in a bullish HTF trend.
// - Short: bearish sweep near resistance or in a bearish HTF trend.
// - For more signals: lower Min volume ratio or Lookback bars.
// - For fewer signals: raise Min volume ratio or Lookback bars.
//@version=6
indicator("Capital41 Liquidity Sweep Simple", overlay = true, max_labels_count = 50)
// Inputs tuned for 30m-4H
lenHighLow = input.int(20, "Lookback bars", minval = 2)
volLookback = input.int(50, "Volume SMA length", minval = 5)
minVolRatio = input.float(1.2, "Min volume ratio", minval = 1.0, maxval = 3.0)
trackConsecutive = input.bool(true, "Show high-prob sweeps")
maxBarsBetween = input.int(10, "Max bars between sweeps", minval = 1, maxval = 100)
colorBull = color.new(color.lime, 0)
colorBear = color.new(color.red, 0)
// Reference levels
priorHigh = ta.highest(high[1], lenHighLow)
priorLow = ta.lowest(low[1], lenHighLow)
// Volume filter
volSma = ta.sma(volume, volLookback)
volRatio = volSma > 0 ? volume / volSma : 0
highVol = volRatio >= minVolRatio
// Sweep logic (confirmed close back inside range)
bullSweep = low < priorLow and close >= priorLow and highVol and barstate.isconfirmed
bearSweep = high > priorHigh and close <= priorHigh and highVol and barstate.isconfirmed
// Consecutive sweeps at similar level within a window
var int consecBull = 0
var int consecBear = 0
var float lastBullLevel = na
var float lastBearLevel = na
var int lastBullBar = na
var int lastBearBar = na
tolerance = close * 0.005
sameLevelBull = not na(lastBullLevel) and math.abs(priorLow - lastBullLevel) <= tolerance
sameLevelBear = not na(lastBearLevel) and math.abs(priorHigh - lastBearLevel) <= tolerance
withinBarsBull = not na(lastBullBar) and bar_index - lastBullBar <= maxBarsBetween
withinBarsBear = not na(lastBearBar) and bar_index - lastBearBar <= maxBarsBetween
if bullSweep
if sameLevelBull and withinBarsBull
consecBull += 1
else
consecBull := 1
lastBullLevel := priorLow
lastBullBar := bar_index
if bearSweep
if sameLevelBear and withinBarsBear
consecBear += 1
else
consecBear := 1
lastBearLevel := priorHigh
lastBearBar := bar_index
highProbBull = bullSweep and consecBull >= 2
highProbBear = bearSweep and consecBear >= 2
// Signals
plotshape(bullSweep and not highProbBull, title = "Bullish Sweep",
style = shape.triangleup, location = location.belowbar,
color = colorBull, size = size.tiny, text = "L")
plotshape(bearSweep and not highProbBear, title = "Bearish Sweep",
style = shape.triangledown, location = location.abovebar,
color = colorBear, size = size.tiny, text = "S")
plotshape(highProbBull and trackConsecutive, title = "High-Prob Bullish Sweep",
style = shape.diamond, location = location.belowbar,
color = colorBull, size = size.tiny, text = "L")
plotshape(highProbBear and trackConsecutive, title = "High-Prob Bearish Sweep",
style = shape.diamond, location = location.abovebar,
color = colorBear, size = size.tiny, text = "S")
// Alerts
alertcondition(bullSweep, title = "Bullish Sweep",
message = "Liquidity Sweep: bullish sweep on {{ticker}} ({{interval}})")
alertcondition(bearSweep, title = "Bearish Sweep",
message = "Liquidity Sweep: bearish sweep on {{ticker}} ({{interval}})")
alertcondition(highProbBull and trackConsecutive, title = "High-Prob Bullish Sweep",
message = "Liquidity Sweep: high-prob bullish sweep on {{ticker}} ({{interval}})")
alertcondition(highProbBear and trackConsecutive, title = "High-Prob Bearish Sweep",
message = "Liquidity Sweep: high-prob bearish sweep on {{ticker}} ({{interval}})")
Overview
Capital41 Liquidity Sweep Simple plots triangular shapes below the bar for bullish sweeps and above for bearish sweeps, along with diamonds for high-probability consecutive sweeps at similar levels. Main settings adjust lookback bars for swing detection, volume SMA length, minimum volume ratio, and consecutive sweep tracking. It draws signals directly on the price chart. The script is non-repainting with signals confirmed only after the bar closes.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Lookback bars
int
20
lenHighLow
Volume SMA length
int
50
volLookback
Min volume ratio
float
1.2
minVolRatio
Show high-prob sweeps
bool
true
trackConsecutive
Max bars between sweeps
int
10
maxBarsBetween
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
The indicator detects liquidity sweeps across key price levels and calculates a cumulative volume delta proxy. It uses pivot high and low lookbacks to identify swing points, marking sweeps when price breaks beyond a level and quickly closes back inside. Featur
Calculates higher-timeframe volume profiles to identify Value Area High (VAH), Value Area Low (VAL), and Point of Control (POC) levels directly on the price chart. It flags potential reversal setups and Change in State of Delivery (CISD) patterns relative to v
Copilot is an order flow range-reversal indicator designed to overlay trading setups directly on the price chart. It evaluates four criteria: market context (sideways vs trending regime based on ATR height), structure (double top or double bottom retests), abs
Supply and Demand Visible Range identifies supply, demand, and equilibrium zones across the visible chart range. It accumulates high, low, and volume data starting from the leftmost visible bar, optionally requesting lower timeframe intrabar data for finer res
This script identifies and visualizes bullish and bearish order blocks on the price chart. It detects low-volatility consolidation ranges followed by breakout moves accompanied by high trading volume. Users can select between Simple, Relative, or Weighted volu
This indicator identifies and visualizes key support and resistance heatmap zones directly on the price chart. Using closed one-hour price data, it evaluates multi-scale pivots, liquidity clusters, relative volume, and round-number resonances to score structur