Pure Price Action Liquidity Sweeps

Pure Price Action Liquidity Sweeps

Summary

Pure Price Action Liquidity Sweeps (by LuxAlgo) detects bullish and bearish liquidity sweeps around recent pivot highs/lows. It plots horizontal liquidity lines from the pivot and highlights sweep zones when price wicks through a level and closes back inside. Untouched (unswept) levels remain as dotted lines; swept levels are drawn solid with a small rectangle marking the sweep.

1) Liquidity Sweeps

  • Liquidity pools often sit above swing highs (buy-stop clusters) and below swing lows (sell-stop clusters).

  • A breakout is price closing beyond a level with follow-through.

  • A liquidity sweep (a.k.a. stop run) is price wicking through a prior high/low to trigger stops, then closing back inside the prior range.

  • After a sweep, markets often revert toward the prior range or pivot area; however, strong trends can ignore this and keep pushing.

2) How the Indicator Works

Pivot detection by depth

You control the sensitivity with profundidad:

  • Short-Term (1): periodoPivote = 5, offset = 2

  • Mid-Term (2): periodoPivote = 13, offset = 6

  • Long-Term (3): periodoPivote = 21, offset = 10

A Pivot High is confirmed when high[offset] equals the highest high over periodoPivote.
A Pivot Low is confirmed when low[offset] equals the lowest low over periodoPivote.

Note: Pivots confirm with a delay (offset) by design—this reduces noise.

Sweep vs mitigation logic

For each active pivot level (within limiteBarras):

  • Bearish sweep (above a Pivot High):
    If price wicks above the pivot high but the close is back below it → mark as swept and draw a small rectangle around the sweep candle’s wick (from pivot to max wick).

  • Bullish sweep (below a Pivot Low):
    If price wicks below the pivot low but the close is back above it → mark as swept and draw a small rectangle (from min wick to pivot).

  • Mitigation (level invalidation):
    If a close beyond the level occurs (close above a high-pivot line for bearish side, or close below a low-pivot line for bullish side), the level is considered mitigated and stops plotting.

Drawing rules

  • Unswept & unmitigated: draw dotted horizontal line from the pivot bar to the current bar.

  • Swept: draw solid line from the pivot bar to the sweep bar, plus a semi-transparent rectangle marking the sweep.

  • Visibility & performance: at most maxLineas lines per side are drawn; only pivots within the last limiteBarras bars are considered. Processing happens at bar close.

3) Reading the Signals on Chart

  • Bearish liquidity sweep (above highs)
    You’ll see a solid red line from the pivot high to the sweep bar and a small red rectangle above the line. This suggests a failed breakout/stop run and potential mean reversion or downside reaction.

  • Bullish liquidity sweep (below lows)
    You’ll see a solid green line from the pivot low to the sweep bar and a green rectangle below the line. This hints at a failed breakdown and potential upside reaction.

  • When to be cautious

    • Strong trends can convert sweeps into continuation (sweep + immediate close through the level on subsequent bars).

    • Dense clusters of equal highs/lows can create multiple sweeps—use context and risk controls.

4) Inputs & Defaults (Configuration Guide)

Input Default What it does Impact
profundidad 1 1 = Short-Term, 2 = Mid-Term, 3 = Long-Term Higher values = fewer, stronger pivots (less noise).
maxLineas 40 Max liquidity lines per side to display Prevents clutter; lower for scalping.
limiteBarras 2000 Lifetime of a pivot level (bars) Limits historical processing & drawing.
RedAlcista GreenAlcista BlueAlcista 8, 153, 129 RGB for bullish lines Visual theme for bullish sweeps.
AlphaAlcista 255 Opacity for bullish solid lines Full opacity on swept lines.
AlphaBarridoAlcista 80 Opacity for bullish fill Semi-transparent sweep rectangle.
RedBajista GreenBajista BlueBajista 242, 54, 69 RGB for bearish lines Visual theme for bearish sweeps.
AlphaBajista 255 Opacity for bearish solid lines Full opacity on swept lines.
AlphaBarridoBajista 80 Opacity for bearish fill Semi-transparent sweep rectangle.

Depth mapping (for quick tuning):

  • profundidad = 1periodoPivote = 5, offset = 2 (fast/short-term)

  • profundidad = 2periodoPivote = 13, offset = 6 (balanced/mid-term)

  • profundidad = 3periodoPivote = 21, offset = 10 (slow/long-term)

5) ProBuilder Code (Paste & Go)

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or
Related users ' posts
FULVIO09 Attualmente non c'è sufficiente volatilità : la condizione "C0 = AverageTrueRange[1500](Clos...
vlongobardo67 Ma io intendevo in backtest ! Scusa non l’ho menzionato.
ciniselloftse salve fulvio .il trading sistem e sempre profittevole?
Vonasi The indicator code can easily be adapted for use as a filter in strategies as well. For exam...
AVT Tested today in manual DAX trading (transcripted to MT and changed look into aka oszillator)...
Vonasi I think that short time frame charts will be too noisy for this indicator. One blue bar real...
Vonasi I forgot to mention in the description that Sunday pivot lines are ignored and Monday's pivo...
AVT Like that, simple and clear!
Vonasi Thanks AVT. I like simple - some people would say that I do simple very well! Sometimes you ...
cervantes2 Buenas tardes y gracias por este magnifico indicador. Queria saber si tienes un proscreener ...
cervantes2 Que busque los valores que la linea verde acaba de cruzar al alza o a la baja
AngelPujalt Tenéis algún screener de este indicador?
Yannick Hello There is a mistake in trailing stop code, I think that this should fix the problem s...
Paul About the trailing-stop the way it's coded. That works for backtesting only, just look at th...
Jonny sorry paul, but system says that is not possible to put many stop order combined...what have...
rb-72 Thank you, area of twist by dilatacion of the price, missing part of the code that is not pu...
Thomas007 after reading your blog now I understand why there is only a part of your code here. I'm try...
Juanjo Hola¡¡ la estrategia se podria aplicar sobre acciones con marco temporal diario?? gracias.
Paul Thanks for posting. I was currently searching how to improve day-trading based on support an...
Jessar Könntest du im Forum etwas öffnen und später darüber zu sprechen?
arahussein Hi All, I am new to trading and i find this indicator very logicail! Hence my (dumb?) quest...
Leo Hi all, I posted a new version of this indicator ( I just add arrows to spot the local maxi...
Trading_En_El_Ibex35 Muchas Gracias por compartir este interesante indicador. Un saludo
xavieralava hola gracias leo
Nicolas https://www.prorealcode.com/topic/ayuda-screener-indicador-perfect-trend-line/#post-51291
Manu L. Bonjour Nicolas, suite a une de mes precedentes demande dans le forum indicateur, j'ai touv...
AntoGH C'est selon moi le meilleur indicateur, que j'ai vu, si vous trouvez mieux dîtes moi car dif...
zilliq Be careful, It works only if you are in daily timeframe, and on your graphic you are on hou...
DerPat I guess you are right, like always. If you change n to 24 you have at least the hours of a d...
gabri DerPat, you can also change line1 to read as follow to adapt this script to hourly timefram...

Top