OPEN-SOURCE SCRIPT
Volume Divergence Scanner

Overview
The indicator combines two independent signal types: Volume Spike (abnormal volume with RSI confirmation) and Divergence (RSI divergence near price extremes). Both must align within a time window to produce a BUY or SELL signal.
Settings
General
Min Bars Between BUY - Minimum bars between any two BUY signals
Min Bars Between SELL - Minimum bars between any two SELL signals
Volume Spike
Enable Volume Spike Signals - Toggle the volume spike component on/off
RSI Length - Period for RSI calculation
Volume MA Length - Short-term volume moving average period
Volume MA Long Length - Long-term volume moving average period (baseline for spike detection)
Buy Multiplier - Volume must exceed long MA by this factor to trigger a buy spike
Sell Multiplier - Volume must exceed long MA by this factor to trigger a sell spike
RSI Buy Level - RSI must be below this level for a buy spike to fire
RSI Sell Level - RSI must be above this level for a sell spike to fire
Min Bars Between BUY - Minimum bars between volume spike buy signals
Min Bars Between SELL - Minimum bars between volume spike sell signals
Divergence
Enable Divergence - Toggle the divergence component on/off
Lookback Bars - Window for detecting local price and RSI extremes
RSI Buy Level - RSI must be below this level for a divergence buy
RSI Sell Level - RSI must be above this level for a divergence sell
Buy Proximity to Low - Price must be within this multiplier of the local low (e.g. 1.02 = within 2%)
Sell Proximity to High - Price must be within this multiplier of the local high (e.g. 0.98 = within 2%)
Min Bars Between BUY - Minimum bars between divergence buy signals
Min Bars Between SELL - Minimum bars between divergence sell signals
VOL+D Confirmation Window - Maximum bars allowed between a Volume Spike and Divergence signal for them to confirm each other
Alerts
Alert: BUY - Enable Trading View alert on BUY signal
Alert: SELL - Enable TradingView alert on SELL signal
Signal Logic
When both components are enabled a BUY fires when either:
A SELL fires by the same logic in reverse.
Tuning Tips
Too few signals:
Too many signals:
Adapting to different assets or timeframes:
The indicator combines two independent signal types: Volume Spike (abnormal volume with RSI confirmation) and Divergence (RSI divergence near price extremes). Both must align within a time window to produce a BUY or SELL signal.
Settings
General
Min Bars Between BUY - Minimum bars between any two BUY signals
Min Bars Between SELL - Minimum bars between any two SELL signals
Volume Spike
Enable Volume Spike Signals - Toggle the volume spike component on/off
RSI Length - Period for RSI calculation
Volume MA Length - Short-term volume moving average period
Volume MA Long Length - Long-term volume moving average period (baseline for spike detection)
Buy Multiplier - Volume must exceed long MA by this factor to trigger a buy spike
Sell Multiplier - Volume must exceed long MA by this factor to trigger a sell spike
RSI Buy Level - RSI must be below this level for a buy spike to fire
RSI Sell Level - RSI must be above this level for a sell spike to fire
Min Bars Between BUY - Minimum bars between volume spike buy signals
Min Bars Between SELL - Minimum bars between volume spike sell signals
Divergence
Enable Divergence - Toggle the divergence component on/off
Lookback Bars - Window for detecting local price and RSI extremes
RSI Buy Level - RSI must be below this level for a divergence buy
RSI Sell Level - RSI must be above this level for a divergence sell
Buy Proximity to Low - Price must be within this multiplier of the local low (e.g. 1.02 = within 2%)
Sell Proximity to High - Price must be within this multiplier of the local high (e.g. 0.98 = within 2%)
Min Bars Between BUY - Minimum bars between divergence buy signals
Min Bars Between SELL - Minimum bars between divergence sell signals
VOL+D Confirmation Window - Maximum bars allowed between a Volume Spike and Divergence signal for them to confirm each other
Alerts
Alert: BUY - Enable Trading View alert on BUY signal
Alert: SELL - Enable TradingView alert on SELL signal
Signal Logic
When both components are enabled a BUY fires when either:
- Volume Spike BUY occurred and a Divergence BUY happened within the last confirmWindow bars
- Divergence BUY occurred and a Volume Spike BUY happened within the last confirmWindow bars
A SELL fires by the same logic in reverse.
- When only Volume Spike is enabled, signals fire on volume spikes alone, without divergence confirmation.
- When only Divergence is enabled, signals fire on RSI divergence alone, without volume confirmation.
Tuning Tips
Too few signals:
- Increase VOL+D Confirmation Window
- Lower Buy Multiplier / Sell Multiplier
- Widen Buy Proximity to Low (e.g. 1.05) and Sell Proximity to High (e.g. 0.95)
- Disable one component to see which fires more frequently
Too many signals:
- Increase Min Bars Between BUY/SELL
- Raise Buy Multiplier / Sell Multiplier
- Tighten Buy Proximity to Low (e.g. 1.01) and Sell Proximity to High (e.g. 0.99)
- Decrease VOL+D Confirmation Window
Adapting to different assets or timeframes:
- Higher timeframes (4h, 1D) generally need higher multipliers and longer MA periods
- More volatile assets may need looser RSI levels and proximity values
- Start with default settings and adjust one parameter at a time
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
VMS://RACCOON — Cutting through the noise.
Telegram: t.me/vms_raccoon
X: x.com/vms_raccoon
Not financial advice
Telegram: t.me/vms_raccoon
X: x.com/vms_raccoon
Not financial advice
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
VMS://RACCOON — Cutting through the noise.
Telegram: t.me/vms_raccoon
X: x.com/vms_raccoon
Not financial advice
Telegram: t.me/vms_raccoon
X: x.com/vms_raccoon
Not financial advice
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。