OPEN-SOURCE SCRIPT

Volume Divergence Scanner

963
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:
  • 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. Подробнее читайте в Условиях использования.