Indicator · Pine Script v5 · On the chart

PipAtlas Liquidity Sweep

by pipatlas26

The PipAtlas Liquidity Sweep indicator detects price sweeps where a candle extends beyond a recent reference high or low but closes back within the prior boundary.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code32
Settings4inputs
LicenceMIT
Last update12 days ago12 Nov 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

32 lines of Pine Script v5 from tradingview/pipatlas-liquidity-sweep.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

pipatlas-liquidity-sweep.pine
//@version=5
//  PipAtlas Liquidity Sweep Detector — https://pipatlas.com/tools
//  Marks the moment a bar trades beyond the previous session high or low and closes back inside.
//  That is a price event, not a prediction: plenty of sweeps keep going. Education only,
//  never financial advice. MIT licensed.
indicator("PipAtlas Liquidity Sweep", overlay = true, max_lines_count = 100)

lookback  = input.int(20, "Bars forming the reference high/low", minval = 5)
useAsia   = input.bool(true, "Restrict the reference window to the Asian session")
asiaSess  = input.session("2000-0200", "Asian session (exchange time)")
showLabels = input.bool(true, "Label each sweep")

inAsia = not useAsia or not na(time(timeframe.period, asiaSess))
sinceStart = ta.barssince(not inAsia == false)  // resets on a session change

refHigh = ta.highest(high, lookback)
refLow  = ta.lowest(low, lookback)

// a sweep: trade through the level, close back the other side of it
sweptHigh = high > refHigh[1] and close < refHigh[1]
sweptLow  = low  < refLow[1]  and close > refLow[1]

plotshape(sweptHigh and showLabels, title = "Swept prior high", style = shape.triangledown,
     location = location.abovebar, color = color.new(color.red, 0), text = "sweep")
plotshape(sweptLow and showLabels, title = "Swept prior low", style = shape.triangleup,
     location = location.belowbar, color = color.new(color.teal, 0), text = "sweep")

plot(refHigh, "Reference high", color = color.new(color.red, 70))
plot(refLow,  "Reference low",  color = color.new(color.teal, 70))

// what the detector cannot do: it cannot see orders, and one sweep is one observation.
alertcondition(sweptHigh or sweptLow, title = "Liquidity sweep", message = "Liquidity sweep on {{ticker}} ({{interval}})")

Overview

Reference levels are calculated over a customizable bar lookback period and can be constrained to the Asian session. It plots the high and low reference lines directly on the price chart and marks detected liquidity sweeps with visual triangle shape labels, supported by built-in alerts.

Details

Published by

pipatlas26 on GitHub

Draws

On the price chart

Markets

Forex

Timeframes

M1-M5, M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

expert-advisorforexmetatrader5mql4mql5pinescriptposition-sizingrisk-managementtrading-indicatorstradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Bars forming the reference high/lowint20lookback
Restrict the reference window to the Asian sessionbooltrueuseAsia
Asian session (exchange time)session2000-0200asiaSess
Label each sweepbooltrueshowLabels
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.

Similar Pine Scripts

Golden Bullet Strategy

by TradersPost
228 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 4 months ago · None stated GitHub repository of Golden Bullet Strategy

This indicator detects and draws the first Fair Value Gap (FVG) that forms in each hourly session based on a selected lower timeframe, with specialized handling for Regular Trading Hours (RTH) confluence windows. It draws FVG range boxes, midpoint lines, hourl

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints

This indicator combines six trading tools into a single chart overlay to optimize indicator limits. It calculates Bollinger Bands, projects weekend price boundaries, plots market structure elements like order blocks, breaker blocks, and MSB lines, marks New Yo

Indicator v6 Support & resistanceSMC / ICT / price action Repaints
34 stars

ICT Everything is a technical analysis indicator that plots Inner Circle Trader (ICT) session ranges, midnight open price lines, and historical session markers directly on the price chart. It highlights major trading sessions including London, New York, London

Indicator v5 SMC / ICT / price actionSessions & time Repaints
Updated 2 weeks ago · MIT GitHub repository of ICT Everything @coldbrewrosh

SMC Marks

by kxngHADES
34 stars

This Pine Script indicator automatically marks Smart Money Concepts on the price chart. It identifies swing highs and lows as HH, HL, LH, LL using a configurable swing length. It detects breaks of market structure (BMS/BOS) and changes of character (CHoCH), wi

Indicator v6 SMC / ICT / price actionTrend
Updated 8 weeks ago · None stated GitHub repository of SMC Marks

More SMC / ICT scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers