OPEN-SOURCE SCRIPT

Volume Scanner (Spikes & Drops) [Context]

131
📌 Purpose
This indicator detects significant volume spikes or drops and optionally filters them by price context (local highs/lows).
It helps identify potential breakout or exhaustion points with improved signal quality compared to raw volume alerts.

🧠 How It Works
1. Volume Spike / Drop Detection
SMA Volume over N bars is calculated as baseline.

Volume Spike: Volume > SMA × Spike Multiplier (default 1.5×).

Volume Drop: Volume < SMA × Drop Multiplier (default 0.5×).

2. Context Filter (optional)
When Use Context = ON:

Bullish Context: Volume spike at/near local price high (last Lookback bars).

Bearish Context: Volume drop at/near local price low (last Lookback bars).

3. Signal Gap
Minimum spacing between signals (Min Gap Bars) prevents excessive clustering.

4. Visuals
Background shading:

Green = Volume Spike in bullish context.

Red = Volume Drop in bearish context.

Alerts can be configured for both conditions.

📈 How to Use
Volume Spikes near highs can indicate breakouts or exhaustion tops.

Volume Drops near lows can signal liquidity dry-up or potential reversals.

Combine with price action or support/resistance for confirmation.

Recommended Timeframes: Works on all timeframes; more reliable on 15m, 1h, 4h.
Markets: Crypto, Forex, Stocks.

⚙️ Inputs
Volume SMA Length

Spike Multiplier / Drop Multiplier

Use Context (High/Low filter)

Min Gap Bars (avoid clustered signals)

⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.