OPEN-SOURCE SCRIPT
Sweep Volume Index [LuxAlgo]

The Sweep Volume Index indicator is a specialized volume analysis tool designed to measure the volume traded specifically during "sweeps" of liquidity levels like swing highs and swing lows. By utilizing intrabar data, the script provides a granular view of market participant activity at key technical levels where liquidity is often concentrated.
Note: This indicator requires access to lower timeframe data. Ensure your chart has sufficient historical data for the intrabar timeframe selected.
🔶 USAGE
The indicator helps traders identify if a breakout beyond a previous structural high or low is a genuine trend continuation or a liquidity grab (stop-run).
🔹 Identifying Reversals
High sweep volume at a key level followed by a price rejection often signals a strong potential for a trend reversal. When the oscillator shows a large spike as price pierces a pivot level but fails to close beyond it, it suggests that "smart money" has absorbed the liquidity.
🔹 Trend Exhaustion
Multiple sweeps appearing in succession with increasing volume but decreasing price extension can indicate trend exhaustion. The decaying envelopes in the oscillator pane help put these volume spikes into context relative to recent historical activity.
🔹 Liquidity Gaps
Low sweep volume might suggest that price has cleared a level with very little resistance or participation, which can potentially lead to a fast continuation as there is no "absorption" taking place.
🔶 DETAILS
A "sweep" occurs when the market price extends beyond a previous structural high or low but fails to sustain that breakout, often resulting in a wick or a "fakeout." The script operates through several stages:
🔶 SETTINGS
🔹 Detection
🔹 Calculation
🔹 Threshold
🔹 Envelopes
🔹 Visuals
Note: This indicator requires access to lower timeframe data. Ensure your chart has sufficient historical data for the intrabar timeframe selected.
🔶 USAGE
The indicator helps traders identify if a breakout beyond a previous structural high or low is a genuine trend continuation or a liquidity grab (stop-run).
🔹 Identifying Reversals
High sweep volume at a key level followed by a price rejection often signals a strong potential for a trend reversal. When the oscillator shows a large spike as price pierces a pivot level but fails to close beyond it, it suggests that "smart money" has absorbed the liquidity.
🔹 Trend Exhaustion
Multiple sweeps appearing in succession with increasing volume but decreasing price extension can indicate trend exhaustion. The decaying envelopes in the oscillator pane help put these volume spikes into context relative to recent historical activity.
🔹 Liquidity Gaps
Low sweep volume might suggest that price has cleared a level with very little resistance or participation, which can potentially lead to a fast continuation as there is no "absorption" taking place.
🔶 DETAILS
A "sweep" occurs when the market price extends beyond a previous structural high or low but fails to sustain that breakout, often resulting in a wick or a "fakeout." The script operates through several stages:
- Pivot Identification: The indicator identifies structural pivot highs and lows based on the Pivot Length input.
- Threshold Zone: A dynamic ATR-based threshold is applied to these levels. This zone defines the area where price can "pierce" without the candle body closing outside, qualifying the move as a sweep rather than a breakout.
- Intrabar Analysis: Using , the script analyzes the volume on a lower timeframe. It only counts volume traded beyond the pivot level during the sweep.
Pine Script® - Sweep Volume Calculation: Bullish Sweep Volume measures volume traded above a Pivot High while the candle body remains below the threshold. Bearish Sweep Volume measures volume traded below a Pivot Low while the candle body remains above the threshold.
🔶 SETTINGS
🔹 Detection
- Pivot Length: Determines the lookback/lookahead period for identifying structural swing highs and lows.
🔹 Calculation
- Intrabar Timeframe: The lower timeframe used to calculate granular volume data. Lower timeframes provide higher precision.
🔹 Threshold
- Use ATR Threshold: Enables a buffer zone around pivots. If the candle body closes within this zone (but beyond the pivot), it is still considered a sweep.
- ATR Length: The period used for the Average True Range calculation.
- ATR Multiplier: Multiplier applied to the ATR to define the width of the sweep zone.
🔹 Envelopes
- Envelope Alpha %: Controls the rate at which the oscillator envelopes decay. Higher values make the envelopes stay elevated for longer.
- Upper/Lower Envelope Color: Sets the colors for the bullish and bearish oscillator envelopes.
🔹 Visuals
- Show Swing Levels: Toggles the visibility of the horizontal pivot lines and ATR zones on the main chart.
- Show Oscillator Fills: Toggles the gradient fills within the oscillator pane.
- Bullish/Bearish Sweep Color: Sets the colors for the volume columns in the oscillator.
- Pivot High/Low Colors & Zones: Customizes the colors for the price levels and the shaded threshold areas on the chart.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
Build your own edge with AI: luxalgo.com
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
Build your own edge with AI: luxalgo.com
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.