HorizonAI
IndicatorPro

Trendline Liquidity

Draws significant trendlines automatically and shows where liquidity is building up along them. Smart money often sweeps this trendline liquidity before reversing—now you can see it coming.

Full Source Code
Alert Templates
Build on with HorizonAI

What's Included

Automatic trendline detection
Liquidity buildup visualization
Trendline break alerts
Liquidity sweep detection
Multi-touch validation
Clean, minimal display

How Trendline Liquidity works

Trendlines connect a series of swing highs or swing lows to visualise the slope of a move. Because so many traders draw and watch the same obvious diagonals, protective stop orders tend to cluster just beyond them: buy stops above a descending trendline, sell stops below an ascending one. That cluster of resting orders is liquidity, and it sits in a predictable place.

Smart-money reasoning holds that large participants need liquidity to fill sizeable orders, so price is frequently drawn to where stops are pooled. A trendline break can therefore be a genuine shift in direction, or it can be a liquidity sweep: price pokes through the line, triggers the clustered stops, and then reverses back inside. Automatically drawn trendlines paired with the liquidity building along them help you distinguish the two.

In practice you watch how price behaves at the sweep. A clean break that holds and retests from the other side suggests continuation, whereas a sharp spike through the line followed by an immediate rejection back inside suggests the move was a stop raid before a reversal. Reading the reaction, not just the break, is the edge.

When to use it

  • Trending markets with a clear diagonal that many participants are obviously watching and drawing.
  • Anticipating stop hunts around a well-established trendline before committing to a breakout.
  • Distinguishing a true trendline break from a false sweep by watching the reaction after the poke.
  • Timing reversal entries when price sweeps trendline liquidity and rejects sharply back inside.

When it's not the right tool

  • Choppy, directionless markets where no meaningful trendline can be drawn and liquidity is scattered.
  • As a guarantee of reversal; sometimes a break is simply a break and the trend continues.
  • Treating every trendline touch as a setup; the concept works best on clean, widely watched lines.

Source Code Preview

Get the full PineScript v6 source code—use it as a foundation and build on top of it with HorizonAI.

trendline-liquidity.pine
1//@version=6
2indicator("Trendline Liquidity", overlay=true)
3// ─────────────────────────────────────
4// Trendline Liquidity - Full Source Code
5// ─────────────────────────────────────
6
7// Input Settings
8pivotLen = input.int(5, "Pivot Length")
9showLabels = input.bool(true, "Show Labels")
10
11// Core Logic
12pivotHigh = ta.pivothigh(high, pivotLen, pivotLen)
13pivotLow = ta.pivotlow(low, pivotLen, pivotLen)
14
15// Structure Detection
16var float lastHigh = na
17var float lastLow = na
18
19if not na(pivotHigh)
20 lastHigh := pivotHigh
21 // ... more logic
22
23// Break of Structure
24bosUp = close > lastHigh

200+ lines of source code

Unlock premium to access the full source code

Unlock Source Code

Frequently asked questions

Why does price so often reverse right after breaking a trendline?

Because stops cluster just beyond obvious trendlines, that zone holds concentrated liquidity. Larger participants can push price through to trigger those stops, fill their own orders against the resulting flow, and then reverse. Not every break is a sweep, but the pattern is common enough to watch for.

How do I tell a real breakout from a liquidity sweep?

Watch the follow-through. A genuine break tends to hold beyond the line and retest it as new support or resistance. A sweep spikes through, fails to hold, and snaps back inside quickly, often on a long wick. Confirmation on a lower timeframe can help.

Are automatically drawn trendlines better than my own?

Automated trendlines apply consistent rules and remove subjective bias, which helps you see the lines the broader market is likely watching. They are a starting point, not gospel; you can still refine them and, with HorizonAI, adjust how they are constructed to fit your approach.

Get access to all 23+ scripts

Full source code, alert templates, and the perfect base to build on with HorizonAI. Join 10,000+ traders.