OPEN-SOURCE SCRIPT

Sweep Volume Shock [Zen]

814
Sweep Volume Shock [Zen] marks liquidity sweeps and shows how much volume each sweep carried: the volume of the sweep candle is divided by the coin's own average volume over the previous 20 closed candles. A sweep on at least 2.0 x the average is SHOCK, a sweep on at most 0.7 x is QUIET, anything in between is NORMAL. The same check runs on a basket of up to 20 crypto perpetuals, and a table shows the most recent sweeps in the basket with their volume multiples, so you can see at once which coins just took a pool on heavy volume and which did it on nothing.

All numbers below are default settings and can be changed in Inputs.

WHAT IS DIFFERENT HERE
Sweep detection, relative volume and basket requests are common building blocks. This script links them coin by coin:
- every sweep is classified by the volume of the sweep candle itself, measured against that coin's own recent volume, not against a fixed number and not against other coins;
- the classification runs on all coins of the basket on every closed candle, and the table lists the most recent sweeps with their side, age, volume multiple and class;
- on the chart coin a SHOCK sweep gets a label whose text is the volume multiple; NORMAL and QUIET sweeps get a small mark, and the tooltip of every mark shows the multiple.
It is not a version of my open-source Liquidity Sweep Breadth [Zen], which measures how many basket coins swept on one candle and draws that share in a lower pane. This script has no lower pane and does not measure breadth; the only basket count here is the number of SHOCK sweeps on the last closed candle, shown in the bottom line of the table and used for the basket alert. It is not a version of Sweep OI Flush [Zen] either: that one works from open interest and keeps outcome statistics; nothing here reads open interest and no outcomes are tracked.

HOW IT WORKS
- Basket: BTC, ETH, SOL, XRP, BNB, DOGE, ADA, LINK, AVAX, LTC, SUI, NEAR, AAVE, ONDO, DOT, TRX, BCH, UNI, APT, ARB (comma separated, no trailing comma; only the first 20 entries are used). Each coin is requested as the chart's exchange + coin + USDT.P on the chart's timeframe, for example BITGET:ETHUSDT.P. A coin that has no such symbol on the chart's exchange is left out; a coin that has no candle at the time of the chart candle is not counted on that candle.
- Pool of a coin: the highest high and the lowest low of its previous 20 closed candles. A coin with fewer than 20 candles of history has no pool and no average yet.
- Sweep: a closed candle whose wick goes beyond the pool and whose close comes back to or inside it (high above the high pool with a close at or below it; low below the low pool with a close at or above it). A candle that sweeps both pools is one sweep with side BSL+SSL; its mark is placed at the high.
- Volume multiple: the volume of the sweep candle divided by the simple average volume of the previous 20 closed candles of the same coin. The sweep candle is not part of its own average. If the average is zero or missing, the multiple is n/a.
- Class: SHOCK when the multiple is at least 2.0; QUIET when it is at most 0.7; NORMAL in between; n/a when the multiple is n/a.
- The chart coin is checked from the candles of the chart itself, the basket coins from their own candles. Every decision is taken on closed candles only.

WHAT YOU SEE
- Marks on the chart coin only. SHOCK: a label with the multiple, for example "x2.4", orange above the high for a BSL sweep, blue below the low for an SSL sweep. NORMAL: a small triangle in the same colours, no text, shown by default. QUIET: a small grey dot, hidden by default. The tooltip of every mark shows the side, the exact multiple and the class. A mark is placed on the sweep candle when it closes and does not move afterwards.
- Table (top right by default). Header: timeframe and lookback. One row per listed coin, the most recent sweep first: Coin, Side (BSL, SSL or BSL+SSL), Ago (closed candles since the sweep, 0 = the last closed candle), Vol x (the multiple) and Class. A coin is listed only if its last sweep happened within the last 48 candles, and at most 10 coins are shown; when more coins qualify, the bottom line says how many swept and how many are shown. The row of a coin that swept on the last closed candle is highlighted. If no coin swept within the lookback, the table has no rows and the bottom line says so.
- Bottom line: how many listed coins are hidden by the row limit (if any), the number of basket coins with a SHOCK sweep on the last closed candle, the number of coins with data out of the basket, and a note that these are historical data, not a forecast.

ALERTS
Every alert is evaluated on the close of a candle; create alerts with the frequency "Once per bar close".
- "Any alert() function call": one message per candle with a SHOCK sweep on the chart coin ("SHOCK sweep: BTCUSDT.P 240 | SSL | x2.4 volume") and/or with at least 3 basket coins on SHOCK on the same candle ("Basket SHOCK sweeps: 5 of 20 coins | BTCUSDT.P 240 | ETH x3.1, SOL x2.6"); if both happen on one candle the message has two lines.
- Two alert conditions: "SHOCK sweep on chart" and "Basket SHOCK sweeps", with the messages "SHOCK sweep on <ticker> <interval>" and "Basket SHOCK sweeps on <ticker> <interval>".
- Use one of the two ways; if you create both, you get two messages for the same event.

HOW TO READ IT
- A SHOCK mark means the pool was taken on heavy trading for this coin; a QUIET sweep means it was taken on almost nothing. The multiple compares a coin with itself: x2.0 on a thin coin and x2.0 on BTC both mean "twice its own average".
- The table tells you where the heavy sweeps in the basket are right now and how old they are; the bottom line tells you whether the last candle was a basket-wide event or a single coin.
- This is context for your own analysis, not an entry signal.

INPUTS (defaults; all inputs are hidden from the status line)
- Pool length (candles): 20
- Volume average (candles): 20
- SHOCK threshold (x average): 2.0
- QUIET threshold (x average): 0.7
- Basket coins (max 20): the list above
- Table lookback (candles): 48
- Table rows (max 20): 10
- Alert: min SHOCK coins on one candle: 3
- Show NORMAL sweep marks: on
- Show QUIET sweep marks: off
- Table position: Top right

REALTIME BEHAVIOUR AND LIMITS
- On the closing tick of a chart candle the other coins' candles may not have their final volume yet, or may not be matched in time, and such a coin is not counted on that candle. The live multiple and class of a basket coin can therefore differ from the values the script gets when it recalculates the history, and after a chart reload the table, the bottom line and the alerts that would have fired can change. The chart coin's own volume is final on a closed candle.
- Up to 200 labels in total, so only the most recent sweeps of the chart coin are marked. The table always shows the current state of the basket.
- The basket is requested from the chart's exchange. On an exchange without USDT perpetuals the bottom line shows 0/20 coins and the table has no rows. On a spot chart the chart coin's sweeps and volume are spot while the basket is read from the perpetuals.
- Exchanges report volume in different units (base coin, quote currency, contracts); the multiple is a ratio within one coin, so the class does not depend on the unit, and raw volume is never shown.
- Up to 20 coins are read on every candle; loading can be slow on very small timeframes with long history.
- Built for standard candles. Heikin Ashi, Renko and other synthetic charts change the prices the script reads.
- Colours follow the chart background (light or dark).

Not financial advice.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.