Liquidity Magnet Zones works as a liquidity zones indicator TradingView traders can point at untapped pools above swing highs and below swing lows. The script scores every zone from 0 to 100 using four weighted factors. It then tracks each zone through three states: fresh, tested and swept. Equal highs and lows get their own orange flag. A stats table reports active zone counts, total sweeps and the nearest magnet level.
It is free and open source. You can add it to any chart from the Liquidity Magnet Zones script page on TradingView, and the full Pine source is published there for you to read.
What Liquidity Magnet Zones plots on the price chart
The script draws one box per swing level. Buyside boxes sit above a swing high in teal. Sellside boxes sit below a swing low in red. Box height defaults to 0.05 percent of the level price. Each box carries a small label holding its magnet score, and equal levels add an EQH or EQL tag in orange. Swept boxes turn grey and stop extending. Triangles mark the sweep bar itself. A seven-row table lists zone counts, total sweeps, average score, sweep rate and the nearest levels.

How Liquidity Magnet Zones is built
Scoring the magnetic pull
The script finds swings with ta.pivothigh and ta.pivotlow. Both use a 5-bar left and right window by default. Each confirmed pivot becomes a zone anchored back at the pivot bar. A buffer of 0.05 percent of price sets the box thickness.
Four factors feed the score. Touch count carries 35 percent of the weight, recency 25 percent, structural prominence 25 percent and relative volume 15 percent. Touch count maps to fixed steps. Five or more touches score 100, three score 75, two score 50, and a single touch scores 20.
Recency uses zone age in bars. Under 50 bars scores 100, under 150 scores 70, under 300 scores 40, and anything older scores 20. Prominence divides the distance beyond the neighbouring bars by ATR(14), then caps the result at 100. Relative volume divides volume at the pivot bar by a 20-period volume average, multiplies by 50 and caps at 100.
Lifecycle and sweep tracking
Every confirmed bar updates the open zones. A zone flips to tested when price comes within half an ATR of the level. The touch count rises by one. The border then switches from dashed to solid at width 2.
A sweep needs a real breach. Buyside zones flip to swept when a bar high trades above the level. Sellside zones flip when a bar low trades below it. Swept boxes stay grey for 50 bars, then delete themselves. The script holds 30 active zones per side and drops the oldest beyond that cap.
Fill transparency tracks the score directly. Scores of 80 and above render at 65 transparency, 60 and above at 75, 40 and above at 82, and the rest at 88. Stronger zones therefore look denser on the chart. The approach alert fires when price sits inside 1.5 ATR of a zone scoring 50 or more.
How to read the signals
Read the number in each label first. A high score means the zone has repeat touches, recent age, clear structure and volume behind it. A score near 20 means one weak touch and little else. Rank your levels by that number.
Watch the orange borders closely. Orange marks equal highs or equal lows inside the 0.1 percent threshold. Those clusters hold resting stop orders. Price often runs straight at them before it turns.
The triangles mark completed sweeps, not forecasts. A downward triangle above the bar shows buyside liquidity taken. Many traders wait for a structure shift after that sweep instead of acting on the triangle itself. The sweep rate cell tells you how often zones on this symbol end up taken out.

Every Liquidity Magnet Zones setting explained
The script exposes 15 inputs, grouped in the settings panel exactly as shown below. Defaults are the published values.
Detection
| Setting | What it does | Default | Range |
|---|---|---|---|
| Swing Length | Number of bars left and right to confirm a swing point. Lower = more zones, higher = fewer but stronger zones | 5 | 2 to 50 |
| Zone Buffer % | Height of each zone as a percentage of the level price. Controls how thick the drawn zones appear | 0.05 | 0.01 to 1.0 |
| Equal Highs/Lows Threshold % | Maximum price difference to consider two swing points as equal highs/lows. Tighter = stricter matching | 0.1 | 0.01 to 0.5 |
Display
| Setting | What it does | Default | Range |
|---|---|---|---|
| Max Active Zones | Maximum number of active zones per side (buyside + sellside). Oldest zones are removed when exceeded | 30 | 5 to 100 |
| Show Score Labels | Display magnet score labels next to each zone | on | on / off |
| Show Stats Dashboard | Display the liquidity statistics table | on | on / off |
| Show Swept Zones | Keep swept zones visible on the chart (grayed out) | on | on / off |
| Swept Zone Lifespan | Number of bars to keep swept zones visible before removing them | 50 | 10 to 200 |
| Table Position | Choose the table position from the listed options. | top_right | top_left, top_center, top_right, bottom_left, bottom_center, bottom_right |
| Text Size | Choose the text size from the listed options. | small | tiny, small, normal |
Colors
| Setting | What it does | Default | Range |
|---|---|---|---|
| Buyside Color | Color for liquidity zones above swing highs | #26A69A | |
| Sellside Color | Color for liquidity zones below swing lows | #EF5350 | |
| Swept Color | Color for swept (invalidated) zones | #787B86 | |
| Equal H/L Color | Highlight color for equal highs/lows detection | #FF9800 |
Alerts
| Setting | What it does | Default | Range |
|---|---|---|---|
| Approach Distance (ATR x) | Alert when price is within this many ATRs of a high-score zone | 1.5 | 0.5 to 5.0 |

Alerts built into Liquidity Magnet Zones
The script ships 5 alert conditions. Open the alert dialog on the chart, pick the indicator as the condition source, then choose the event you want. Alerts fire on the close of the bar, so they follow the same confirmed-bar rule the on-chart signals use.
- Buyside Liquidity Swept
- Sellside Liquidity Swept
- Any Liquidity Sweep
- Approaching Buyside Liquidity
- Approaching Sellside Liquidity
Other markets and timeframes
Every threshold in the script scales with the instrument. Zone height uses a percentage of price. Prominence divides by ATR(14). The equal-level test uses a percentage gap. Relative volume compares each pivot to its own 20-bar average. Nothing sits hard-coded in pips or dollars, so the maths runs on forex, indices, crypto and stocks without edits. One caveat applies: spot forex feeds report broker tick volume rather than exchange volume, so the volume factor counts ticks there.

Limitations worth knowing
Zones appear late by design. A pivot needs 5 bars to its right before ta.pivothigh confirms it. The box then back-dates to the pivot bar, so the level looks earlier than the moment it actually printed. Plan around that lag.
The score ranks structure, not direction. A 90-score zone says price has strong reason to visit that level. It says nothing about what happens after the visit. The script offers no stop, no target and no position size.
The script caps at 30 zones per side and 500 boxes in total. On low timeframes with a short swing length, older zones drop off the chart. It also keeps no historical hit statistics beyond the running sweep rate, and past performance does not predict future results.
Get Liquidity Magnet Zones on TradingView
Open Liquidity Magnet Zones on TradingView
If you also trade MetaTrader, the MT4 and MT5 indicator library is available below.
Get the complete indicator library
One email unlocks the full MT4 and MT5 indicator library. This TradingView script stays free on TradingView – the button above adds it to your chart.
Using it alongside MetaTrader
Adding a script on TradingView takes one click, so there is no install step here. If you want the same idea on MetaTrader, the MT4 and MT5 indicator installation guide walks through copying files into the data folder and attaching them to a chart. You can also browse the full MetaTrader indicator library, the MT4 indicators section, or the other free TradingView scripts published on this profile. For related chart tools see the MT5 indicators section and the forex trading strategies guides.
External references
- Flight-to-liquidity on Wikipedia
- Liquidity at Investopedia
- Support And Resistance at StockCharts ChartSchool
Frequently asked questions
Does Liquidity Magnet Zones repaint?
No. The script gates zone creation and every lifecycle update behind barstate.isconfirmed, so it acts only on closed bars. Zones do draw back to the pivot bar, which is standard pivot behaviour, and confirmation takes 5 bars at the default swing length.
What does the magnet score actually measure?
It blends four inputs into one 0 to 100 number. Touch count supplies 35 percent, recency 25 percent, prominence relative to ATR 25 percent, and relative volume 15 percent. A fresh, prominent level tapped several times on heavy volume lands near the top of the range.
Which timeframe suits it best?
The logic stays timeframe agnostic. H1 and H4 give cleaner swing structure at the default 5-bar swing length. On M5 or M1, raise Swing Length to 8 or 10 so noise stops creating low-value zones.
What alerts ship with the indicator?
Five alert conditions cover buyside sweeps, sellside sweeps, any sweep, and price approaching a high-score zone on either side. The approach alerts need a score of at least 50 and a distance under 1.5 ATR.
How much should I rely on this indicator?
Treat it as one input, not a decision. It is a chart analysis tool, not trading advice. Test it on your own markets and timeframes before relying on it. Results are not guaranteed; past performance is not indicative of future results.
